Saravanan666/pypi-org huggingface dataset:
Package: conda-vendor
Conda-VendorConda Vendor is a tool to create local conda channels and attestetation manifests based on an input conda environment yaml file. This tool is particularly useful when trying to use conda packages inside an air-gapped network.InstallationTo install withpip, run:pipinstallconda-vendorTo install withconda, run:condainstall-cconda-forgeconda-vendorDevelopment InstallationCreate a conda environment with conda-vendor development dependencies:mambaenvcreate--fileenvironment.yamlInstall conda-vendor as an editable pip package:pipinstall-e.Running Tests:pytesttests/-vvv-sUsageSupported SolversCondaMambaMicromambaVendor dependencies from anenvironment.yamlinto a local channel:# Use conda as the solver for linux-64conda-vendorvendor--fileenvironment.yaml--solverconda--platformlinux-64# use mamba as the solver for osx-64conda-vendorvendor--fileenvironment.yaml--solvermamba--platformosx-64# use micromamba as the solver for the host platformconda-vendorvendor--fileenvironment.yaml--solvermicromambaUse Dry-Run install to verify that conda can solve using only the vendored channel:# NOTE: ensure to use the same solver used to create the vendored channel# example channel vendored with mamba: that includes micromamba python and pipmambacreate-nsome-new-env--offline--channel./my-vendored-channel--override-channels--dry-runmicromambapythonpip
Package: condax
condaxCondax is inpired by the excellentpipx, and attempts to do something similar, just using conda thus lifting the constraints of only packaging python things.Installationcondax is distributed onPyPIas a universal
wheel and is available on Linux and macOS and supports
Python 3.5+ and PyPy.$pipinstallcondaxLicensecondax is distributed under the terms of theMIT License.
Package: conda-xdgpatch
InstallationOn your base conda-installation, install via pip:>cd/opt/tools/conda
>bin/pipinstallconda-xdgpatchUsageJust use conda to create conda-environments.Registered sitecustomize-entrypointTheconda_xdgpatch.patch-function is registered as asitecustomize-entrypoint in our pyproject.toml_:[tool.poetry.plugins][tool.poetry.plugins."sitecustomize"]conda_xdgpatch="conda_xdgpatch:patch"Sitecustomize and all its registered entrypoints will be executed at the start ofeverypython-process.
For more information, please seesitecustomize-entrypointsCompatibilityconda-xdgpatchworks on Python 3.8+, including PyPy3. Tested until Python 3.11,Notable dependencies[conda](http://pypi.python.org/pypi/condasitecustomize-entrypoints
Package: condensa
A Programming System for Model CompressionCondensa is a framework forprogrammable model compressionin Python.
It comes with a set of built-in compression operators which may be used to
compose complex compression schemes targeting specific combinations of DNN architecture,
hardware platform, and optimization objective.
To recover any accuracy lost during compression, Condensa uses a constrained
optimization formulation of model compression and employs an Augmented Lagrangian-based
algorithm as the optimizer.Status: Condensa is under active development, and bug reports, pull requests, and other feedback are all highly appreciated. See the contributions section below for more details on how to contribute.Supported Operators and SchemesCondensa provides the following set of pre-built compression schemes:Unstructured PruningFilter and Neuron PruningBlock PruningQuantizationScheme CompositionThe schemes above are built using one or morecompression operators, which may be combined in various ways to define your own custom schemes.Please refer to thedocumentationfor a detailed description of available operators and schemes.PrerequisitesCondensa requires:A working Linux installation (we use Ubuntu 18.04)NVIDIA drivers and CUDA 10+ for GPU supportPython 3.5 or newerPyTorch 1.0 or newerInstallationThe most straightforward way of installing Condensa is viapip:pipinstallcondensaInstallation from SourceRetrieve the latest source code from the Condensa repository:gitclonehttps://github.com/NVlabs/condensa.gitNavigate to the source code directory and run the following:pipinstall-e.Test out the InstallationTo check the installation, run the unit test suite:bashrun_all_tests.sh-vGetting StartedTheAlexNet Notebookcontains a simple step-by-step walkthrough of compressing a pre-trained model using Condensa.
Check out theexamplesfolderfor additional, more complex examples of using Condensa (note: some examples require thetorchvisionpackage to be installed).DocumentationDocumentation is availablehere. Please also check out theCondensa paperfor a detailed
description of Condensa's motivation, features, and performance results.ContributingWe appreciate all contributions, including bug fixes, new features and documentation, and additional tutorials. You can initiate
contributions via Github pull requests. When making code contributions, please follow thePEP 8Python coding standard and provide
unit tests for the new features. Finally, make sure to sign off your commits using the-sflag or addingSigned-off-By: Name<Email>in the commit message.Citing CondensaIf you use Condensa for research, please consider citing the following paper:@article{condensa2019,
    title = {A Programmable Approach to Model Compression},
    author = {Joseph, Vinu and Muralidharan, Saurav and Garg, Animesh and Garland, Michael and Gopalakrishnan, Ganesh},
    journal = {CoRR},
    volume = {1911.02497},
    year = {2019},
    url = {https://arxiv.org/abs/1911.02497}
}DisclaimerCondensa is a research prototype and not an official NVIDIA product. Many features are still experimental and yet to be properly documented.
Package: condenser
A fast interface between SQLAlchemy and NumpyFeaturesThis project reads data from SQLAlchemy into structured numpy arrays. Next to
the builtin SQLAlchemy types, it also supports reading geometries intopygeosarrays of geometries.InstallationInstall via pip using:$ pip install condenserInclude geometry support:$ pip install condenser[geo]Usagecondenserexposes one object:NumpyQuery, which is used
as a custom SQLAlchemy query class as follows:>>> from condenser import NumpyQuery
>>> # create the session with a custom query class
>>> session = session_factory(query_cls=NumpyQuery)If a session is constructed like that, every query object will have an
additional method to dump the selected data into a numpy structured array:>>> query = session.query(SomeModel.float_type_column, SomeModel.int_type_column)
>>> my_array = query.as_structarray()Geometry supportGeometry columns are automatically converted to arrays ofpygeos.Geometryobjects. Seehttps://pygeos.readthedocs.ioon for (vectorized) numpy functions
that can act on these arrays.Transform geometries (using theST_Transformdatabase function) as follows:>>> query.with_transformed_geometries(target_srid=28992)Note that this will only transform geometries with a known SRID. If an SRID is
known only from another metadata source, use a function appropriate to your
database backend to set the projection before converting it. Another option
is using thepyprojlibrary in combination withpygeos.applyto
transform geometries from Python.Custom dtype mappingcondenserhas a safe approach on guessing the Numpy dtypes from SQLAlchemy
dtypes. It always takes 8-byte signed integers and floats. For some database
backends this can be changed to for example 4-byte datatypes.
Override an SQLAlchemy to NumPy type mapping after constructing the query:>>> from sqlalchemy import Integer
>>> query = session.query(SomeModel.float_type_column)
>>> query.numpy_settings[Integer]["dtype"] = np.int32
>>> query.as_structarray()Or globally:>>> NumpyQuery.default_numpy_settings[Integer]["dtype"] = np.int32NULL valuesMost numpy datatypes handle NULL (Python: None) values natively. Only integer
typed columns deserve extra attention as they have no equivalent in the NumPy
integer dtype. This package converts NULLs in integer columns to-1by
default. A complete list of what to expect:NULL in integer columns becomes-1NULL in float and numeric columns becomesnanNULL in boolean columns becomesFalseNULL in object typed columns (string, text, geometry) becomesNoneAdjust the NULL value before executing the query:>>> from sqlalchemy import Integer
>>> query = session.query(SomeModel.float_type_column)
>>> query.numpy_settings[Integer]["null"] = -9999
>>> query.numpy_settings[Boolean]["null"] = True
>>> query.as_structarray()Or globally:>>> NumpyQuery.default_numpy_settings[Integer]["null"] = -9999CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: condent
condentis a quick hack to reindent containers the way that I like them.It’s mostly (currently entirely) for Python, but due to similar object literal
syntaxes it should work for other languages by chance, and is easily
generalizable to actually work with them in case it doesn’t. I suspect over
time I’ll add actual support for the other languages I use on a semi-regular
basis (mostly Ruby and JS).It can fix basic things like:SpacingMoving something that fits on a single line onto one lineMoving something that doesn’t onto multiple linesFixing indentation of multiple line containersWhat it won’t (shouldn’t) do is change the semantics of your code. If it does,
please open a ticket.InstallationInstall withpip install condentand you’ll find acondentexecutable
installed.UsageSample invocation and output is:$ echo 'd = {"foo":"bar","baz":"quux"}' | condent
d = {"foo" : "bar", "baz" : "quux"}

$ condent <<EOF
the_dict = {
foo:bar,
baz:quux,
spam:eggs}'
EOF
the_dict = {foo : bar, baz : quux, spam : eggs}

$ condent <<EOF
    an_already_indented_dict_that_does_not_fit_on_one_line = {
foo:bar, baz:quux,
spam:eggs}
EOF
    an_already_indented_dict_that_does_not_fit_on_one_line = {
        foo : bar,
        baz : quux,
        spam : eggs,
    }You can see full usage info withcondent-h.Usage With VimThe main reason this exists is to use withvimand itsequalprgoption.To do so, put something likeautocmd FileType python set equalprg=condentin your.vimrcor in anftpluginfile. You can then use it with=(see:help =for details).I’ve tried a number ofvimindent scripts over the past few years but never
found one that worked right. Maybe it exists and it’s my (settings’) fault,
but rather than figure out whether that’s the case it was easy enough to throw
together in an afternoon.You also might be interested in myftpluginfile forPythonwhich has some more of what I do with this, like auto-reindenting when
inserting closing characters.StyleItshouldbepep8compliant with one exception.I like mydictkey and value to be symmetric around the:. Depending on
interpretation this might be in violation ofpep8recommending avoiding
extra whitespace, but I’ve been doing it forever and I like the way it looks,
not to mention I’ve seen a ton of code that does it this way as well. To
illustrate, this will produce{"foo" : "bar"}rather than producing{"foo": "bar"}. If you really don’t like that you can disable it with the
command line flag--no-symmetric-colon. There are a bunch of other
subjective style choices that can be toggled with command line flags.Adding FeaturesLike many similar things, this is likely going to be a continual WIP. Like I
said, I use things like this daily, so as I find bugs or desired features I’ll
probably fix or add them.There are a few specific things I have in mind which will probably get added
in the next couple of days. If you have others, feel free to send a pull
request. Even if I don’t like or use the style you desire, if it’s sane enough
;) it probably be merged as an option anyhow.
Package: condiment
Condiment=========Conditionally include or remove code portion, according to the environment. Itsupport offline and on-thy-fly preprocessing.Conditional features--------------------Let's say you want to release a version of your code with or without a feature,like unlimited life in a game. It can be useful during development, but youdon't want the code to be available in production.Condiment recognize the environment variables that starts with the prefix"WITH_" all uppercase. We could name our feature: `WITH_GODMODE`.In python, you need to include condiment, and install it. You can put it inexclude block, in order to be removed during the offline preprocessing.```python#excludeimport condiment; condiment.install()#endexcludeclass Player:def die(self):if not WITH_GODMODE:self.life -= 1return self.life```You can run it without the godmode:```$ python main.py```Or by activating the godmode at runtime:```$ WITH_GODMODE=1 python main.py```You can generate the final version for production too:```$ WITH_GODMODE=1 condiment main.py > prod_main.py$ cat prod_main.pyclass Player:def die(self):self.life -= 1return self.life```Replacing variables-------------------If you want to set an initial value, all the token founds in the environmentwill be replaced during the generation. For example, a `WITH_LIFE` token couldhave the initial number of life.```python#excludeimport condiment; condiment.install()#endexcludeclass Player:def __init__(self):Player.__init__(self)self.life = 10if WITH_LIFE:self.life = WITH_LIFEdef die(self):if not WITH_GODMODE:self.life -= 1return self.life```Why using condiment ?---------------------Compared to others existing preprocessor:- condiment doesn't rewrite the module on import, it will just inject thedetected variables in the globals() of the module. This is avoiding doubleimport of your module.- condiment use python expression for condition (only on if)- condiment doesn't need you to declare the variable prior the usage of them.Using environment variables allow you to declare them before launching theapp, and change the behavior of your app easilly.- condiment will replace all the variables in offline version.Related projects----------------- pypreprocessor- preprocess
Package: condition
ConditionProject DescriptionThis project provides a user friendly way to construct a condition object. The condition
object can be passed around and later used in various contexts, such as querying pandas Dataframe,
filtering pyarrow partitions or generating where clauses in SQL. It takes care of formating and syntax for you.
It also supports extensibility to new usage contexts.A Quick Example>>>fromconditionimport*>>>importpandasaspd>>>fl=FieldList('A B C date value'.split())>>>cond=((fl.date>=pd.to_datetime('20000101'))...&(fl.date<=pd.to_datetime('20010131'))...&(fl.A=='a1 a3'.split())\...&(fl.B=='b1'))\...|(fl.C!='c3 c5'.split())>>>print(cond)# show as sql where condition((date>='2000-01-01 00:00:00'anddate<='2001-01-31 00:00:00'andAin('a1','a3')andB='b1')orCnotin('c3','c5'))>>>cond.to_df_query()"(((date >= '2000-01-01 00:00:00')&(date <= '2001-01-31 00:00:00')&(A in ('a1','a3'))&(B == 'b1'))|(C not in ('c3','c5')))">>>cond.to_pyarrow_filter()[[('date','>=',Timestamp('2000-01-01 00:00:00')),('date','<=',Timestamp('2001-01-31 00:00:00')),('A','in',{'a1','a3'}),('B','=','b1')],[('C','not in',{'c3','c5'})]]SQL Generation>>>fromcondition.sqlimportrender_sql>>>sql="""...     select *...     from my_table...     where {{where_condition}}... """>>>print(render_sql(sql,cond))select*frommy_tablewhere((date>='2000-01-01 00:00:00'anddate<='2001-01-31 00:00:00'andAin('a1','a3')andB='b1')orCnotin('c3','c5'))Please seeUsage Examplesfor detailed examples.InstallationThis project is distributed viapip. To get started:pip install conditionTo install jinja2 package used by condition.sql, do the followingpip install "condition[sql]"To install all packages for development, do the followingpip install "condition[dev]"
Package: conditional
Package Contentsconditional(condition, contextmanager)Enter contextmanager only if condition is true.OverviewTheconditionalcontext manager comes handy when you always want to
execute a with-block but only conditionally want to apply its context
manager.If you find yourself writing code like this:ifCONDITION:withCONTEXTMANAGER():BODY()else:BODY()Consider replacing it with:withconditional(CONDITION,CONTEXTMANAGER()):BODY()TypingThe context manager ships with type annotations. Type checkers and IDEs can
use this information to implement type safety and auto completion.ExamplesSay we want to ignore signals when a pager application is in the
foreground, but not otherwise:fromconditionalimportconditionalwithconditional(has_pager(cmd),ignoresignals()):os.system(cmd)DocumentationFor further details please refer to theAPI Documentation.Changelog1.5 - 2023-09-14Add type annotations to the context manager.
[stefan]Update tox.ini for latest tox.
[stefan]Add GitHub CI workflow.
[stefan]Add .readthedocs.yaml file.
[stefan]Pin sphinx and sphinx-rtd-theme versions in docs extra.
[stefan]Add mypy extra which installs mypy.
[stefan]1.4 - 2022-03-09Add Python 3.8-3.10 to tox.ini. Remove old Python versions.
[stefan]Replace deprecatedpython setup.py testin tox.ini.
[stefan]Remove deprecatedtest_suiteandtests_requirefrom setup.py.
[stefan]Move metadata to setup.cfg and add a pyproject.toml file.
[stefan]Include tests in sdist but not in wheel.
[stefan]1.3 - 2019-01-28Add MANIFEST.in.
[stefan]Release as wheel.
[stefan]1.2 - 2017-02-05Support Python 2.6-3.6 without 2to3.
[stefan]Add a LICENSE file.
[stefan]1.1 - 2014-04-19Remove setuptools from install_requires because it isn’t.
[stefan]1.0 - 2012-05-16Initial release.
[stefan]
Package: conditional-context
Context manager that will skip the body on a condition.All code is inconditional_context/__init__.pyExamplesCondition function examplefromconditional_contextimportconditionprint('start')value=Truewithcondition(False):value=Falseprint('here')# Will not printprint('end')assertvalueCustom class replacing theshould_skipmethod exampleimportconditional_contextclassMyContext(conditional_context.ConditionalContext):defshould_skip(self):returnTrueprint('start')value=TruewithMyContext():value=Falseprint('here')# Will not printprint('end')assertvalueReplace theshould_skipmethod with a decoratorimportconditional_contextctx=conditional_context.ConditionalContext()@ctx.replace_should_skipdefmy_should_skip():returnTrueprint('start')value=Truewithctx:value=Falseprint('here')# Will not printprint('end')assertvalue,'ConditionalContext class did not skip properly'Breakout function to stop running the context without showing an error.fromconditional_contextimportconditionvalue1=Truevalue2=Truevalue3=Truewithcondition()asctx:value1=Falsevalue2=Falsectx.breakout()# Should raise an error to break out of the context.value3=Falseassertvalue1isFalseassertvalue2isFalseassertvalue3isTrue,'The breakout feature did not work as expected!'
Package: conditional-get
conditional-getCLI tool for fetching data usingHTTP conditional get.Installationpip install conditional-getUsageThe first time you run this command it will download the file and store the ETag (if one was returned) in a file calledetags.json.The second time you run this command against the same URL it will use that ETag, potentially resulting in a304 Not Modifiedresponse which saves bandwidth by not re-downloading the file.# First run - will fetch the file
conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png
# Second run - will only fetch the file if it has changed
conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.pngThe filename will be derived from the URL. You can customize the filename using the-ooption:conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png -o til.pngBy default the ETags for the retrieved URLs will be stored in aetags.jsonfile in the current directory. You can use the--etags otherfile.jsonto store that file somewhere else:conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png --etags my-etags.jsonUse the-voption to get debug output showing what is happening:$ conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png -v
Response status code: 200
[####################################]  100%

$ ls
Simon_Willison__TIL.png	etags.json

$ cat etags.json 
{
    "https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png": "\"d65b78782dfa93213c99099e0e2181d8\""
}

$ conditional-get https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png -v
Existing ETag: "d65b78782dfa93213c99099e0e2181d8"
Response status code: 304The key used to store the ETag inetags.jsondefaults to the URL. You can specify a custom key using the--keyoption:conditional-get --key til https://static.simonwillison.net/static/2020/Simon_Willison__TIL.png
cat etags.json
{
    "til": "\"d65b78782dfa93213c99099e0e2181d8\""
}This is useful if the URL to the file changes even though the file contents stays the same - for example if you are downloading files from URLs that include an expiring signature.
Package: condition-chain
Condition Chain===============Process a series of conditional judgement with a chained call.Example------->>> from condition_chain import Condition>>> condition = Condition(1).be(2).equal(2.0 - 2)\.differ('a').instance_of(str).expect(lambda x: x, 1)>>> print(condition.result(), condition.success, condition.failures, sep='\n')False[('be', 2), ('equal', 0.0), ('differ', 'a'), ('instance_of', 'str'), ('expect', ('<lambda>', 1))][('be', 2), ('equal', 0.0), ('instance_of', 'str')]>>> condition = Condition([1,2,3]).contain(1).have('append').hold(3)True[('contain', 1), ('have', 'append'), ('hold', 3)][]Install-------.. code-block:: shellpip install condition_chainAuthor------Yixian Du (duyixian1234@outlook.com)
Package: conditionevaluator
ProjectNameProjectName and Description"优雅的if-else替换"优化并美观你的if-else探索本项目的文档 »查看Demo·报告Bug·提出新特性目录文件目录说明上手指南环境要求安装依赖包1.在需要做多条件判断的函数中引入装饰器2.其他函数调用3.测试使用到的框架版本控制作者鸣谢文件目录说明conditionevaluatortool 
├── /conditionevaluator/
│  ├── __init__.py
│  ├── conditionevaluator.py
├── /test/
│  ├── __init__.py
│  ├── test.py
├── README.md
└── setup.py上手指南环境要求Python 3.7.0安装依赖包pip install conditionevaluator使用步骤1.在需要做多条件判断的函数中引入装饰器importconditionevaluator@conditionevaluatordefdoorType(door):"""条件1:param door: 门类型  2  --> 双开门:return: bool"""return"门类型错误"2.其他函数调用@doorType.register(1)defparams_door_type_1(door):"""条件1:param door::return: False"""count=1returncount@doorType.register(2)defparams_door_type_2(door):"""条件2:param door::return: True"""count=2returncount3.测试if__name__=='__main__':print(params_door_type_2(1))# 结果输出>>>2使用到的框架暂无版本控制该项目使用Git进行版本管理。您可以在repository参看当前可用版本。作者cywhat🔗个人博客鸣谢GitHub Emoji Cheat SheetImg ShieldsChoose an Open Source LicenseGitHub Pagesedgedb
Package: conditions-py
Conditions-PYConditions is a Python port of the famous .NET libraryConditionswhich helps developers write pre- and postcondition validations in a fluent manner. Writing these validations is easy and it improves the readability and maintainability of code.ContentsInstallationConditionsTestsExamplesAcknowledgementsInstallationInstallation is done via PIP:pip install conditions-pyConditionsA full list of all the available conditions can be found in theWiki.TestsCurrently both unit and integration tests are written using thepytestlibrary. Execution of tests in Visual Studio Code is performed using thepytesttest runner.Examplesimportconditions_pydefspeak(message:str):Condition\.requires_str(message,'message')\.is_not_null_or_whitespace()# Do speaking...defmultiple(left:int,right:int):Condition\.requires_num(left,'left')\.is_positive()Condition\.requires_num(right,'right')\.is_greater_than(4)# Do multiplicationdefis_true(value:bool):Condition\.requires_bool(value,'value')\.is_true()# Do other stuffdefanimals(dog:object,cat:object):Condition\.requires_obj(dog,'dog')\.is_not_null()Condition\.requires_obj(cat,'cat')\.is_null()# Do other stuffA particular validation is executed immediately when it's method is called, and therefore all checks are executed in the order in which they are written:AcknowledgementsThe icon "Tornado" designed byAdam Whitcroftfrom The Noun Project.Geoffrey Huntley (ghuntley)who is the original author of "Conditions" from which this project was based on.