Saravanan666/pypi-org huggingface dataset:
Package: pyaslengine
pyaslenginePython engine forAmazon States Language (ASL)specification that supports parsing and serialization of definitions, and a local interpreter to run them.InstallationDevelopmentgitclonehttps://github.com/ghukill/pyaslengine
makeinstallUse in Existing ProjectpipinstallpyaslengineExamplesLoad simple StateMachine definition from local JSON fileimportloggingfrompyaslengine.dataimportWorkflowInputfrompyaslengine.workflowsimportStateMachine# turn on debug logginglogging.getLogger('pyaslengine').setLevel(logging.DEBUG)# initialize a state machine by reading a local JSON filesm=StateMachine.load_definition_file("tests/fixtures/state_machines/do_nothing.json")# run the state machine by passing an initial payloadresults=sm.run(workflow_input=WorkflowInput(data={"msg":"in a bottle"}))# Out[6]: WorkflowOutput(data={'msg': 'in a bottle'}, context=None)
Package: pyasli
PyasliSimple selenium python wrapperThere are two ways to use browser:Use default shared driver:frompyasli.browsersimportbrowserbrowser.base_url="https://the-internet.herokuapp.com"browser.open("/disappearing_elements")element1=browser.element("div.example p")assertelement1.get_actual()iselement1.get_actual(),"Element is found 2 times"Use exact driver (can be used as context manager):frompyasli.browsersimportBrowserSessionwithBrowserSession("chrome",base_url="https://the-internet.herokuapp.com")asbrowser:browser.open("/disappearing_elements")element1=browser.element("div.example p")assertelement1.get_actual()iselement1.get_actual(),"Element is found 2 times"In casebrowser_instanceis used as context manager, all browser windows will be closed at
exiting contextThere is no documentation currently. For usage please refer to tests
Package: pyasm
PyASMPyASM is a python library designed to help modify bytecode in a somewhat easy manner.
The API design is loosely based on objectweb:asm for Java.FeaturesDeconstruct code objectsYou can use theasm.Deserializerclass to convert a code object into a list of opcodes>>>fromasmimport*>>>>>>defmy_function(x:int=1)->int:...ifx>20:...returnx/20...returnx...>>>deserializer=Deserializer(my_function.__code__)>>>deserializer.deserialize()# Below is formatted for readability[LOAD_FAST(id=124,arg='x'),LOAD_CONST(id=100,arg=20),COMPARE_OP(id=107,arg=4),POP_JUMP_IF_FALSE(id=114,arg=Label(0x7fd2fbeb0d60)),LOAD_FAST(id=124,arg='x'),LOAD_CONST(id=100,arg=20),BINARY_TRUE_DIVIDE(id=27,arg=0),RETURN_VALUE(id=83,arg=0),Label(0x7fd2fbeb0d60),LOAD_FAST(id=124,arg='x'),RETURN_VALUE(id=83,arg=0)]Construct code objectsConversely, you can also turn a list of opcodes into a code object usingasm.Serializer>>>fromasmimport*>>>>>>dummy=lambdax:None>>>serializer=Serializer([# Bytecode for `return x * 20`...LOAD_FAST("x"),...LOAD_CONST(20),...BINARY_MULTIPLY(),...RETURN_VALUE()...],dummy.__code__)>>>dummy.__code__=serializer.serialize()>>>dummy(10)200JumpsA big issue when modifying bytecode is jumps. We solve this by usingasm.Label:>>>fromasmimport*>>>lbl=Label()>>>ops=[...LOAD_CONST(10),...LOAD_CONST(20),...COMPARE_OP("<"),...POP_JUMP_IF_FALSE(lbl),# jump to where lbl is located...LOAD_CONST(True),...RETURN_VALUE(),...lbl,# jump to here...LOAD_CONST(False),...RETURN_VALUE()...]This way, no matter how many instructions you place between the jump and the label, it will always resolve correctly.InstallingTo install PyASM, you can just use pip:pipinstallpyasmLicensePyASM is licensed under MIT.
Package: pyasmer
PyasmerEnPyasmer is a python bytecode manipulation library.
It can be used to modify existing code object(e.g.func.__code__), directly in binary form.Pyasmer helps developers to perform some dynamic stubbing, proxy, instruction generation, in existing python code.Using it requires you to have some knowledge of Python bytecode and the CPython VM execution mechanism,
which you can get from the official documentation:https://docs.python.org/3/library/dis.html.
Pyasmer will also provide some easy-to-use interfaces that are less difficult to use.Fox example:importsysfrompyasmer.asm_instructionimportasm_global_var,asm_fast_varfrompyasmer.code_writerimportCodeWriterif__name__=='__main__':_frozen_importlib=sys.modules['_frozen_importlib']# The _find_and_load_unlocked function will be called when import module_find_and_load_unlocked=getattr(_frozen_importlib,'_find_and_load_unlocked')cw=CodeWriter(_find_and_load_unlocked.__code__)()# Add a print statement to the beginning of the _find_and_load_unlocked function# to print out the name of the module which to be imported## The insertion position is at the beginning of the function(0 instruction)cw.update_position(offset=0)# None: Ignore return value# asm_global_var('print'): called function is print# asm_fast_var('name'): local variable `name` pass to printcw.call_function(None,asm_global_var('print'),asm_fast_var('name'))cw.gen_code()# Execute the import commandimportastThe output shows that there are two modules that are imported in the process.output:ast_astFor more information on how to use it, please refer to the tests directory.中文Pyasmer是一个Python字节码编辑库。它可以用来修改现有的二进制代码(例如,func.__code__)。Pyasmer可以帮助开发者在python代码中执行一些动态地在已有代码中插桩、代理、指令生成，使用它需要你具备一定的Python字节码和CPython虚拟机执行机制，你可以从官方文档获取这些知识：https://docs.python.org/3/library/dis.html。
Pyasmer也会提供一些易于使用的接口，降低使用难度。举个例子：importsysfrompyasmer.asm_instructionimportasm_global_var,asm_fast_varfrompyasmer.code_writerimportCodeWriterif__name__=='__main__':_frozen_importlib=sys.modules['_frozen_importlib']# _find_and_load_unlocked函数会在import模块的时候被调用_find_and_load_unlocked=getattr(_frozen_importlib,'_find_and_load_unlocked')cw=CodeWriter(_find_and_load_unlocked.__code__)()# 在_find_and_load_unlocked函数开头添加一个print，将要被import的模块名称打印出来## 更新插入位置到函数开头(第0条指令)cw.update_position(offset=0)# None: 忽略返回值# asm_global_var('print'): 调用的函数为print# asm_fast_var('name'): 将局部变量`name`传给printcw.call_function(None,asm_global_var('print'),asm_fast_var('name'))cw.gen_code()# 执行import命令importast输出显示有两个模块在import命令过程中被引用。output:ast_ast更多的使用方法可以参考tests目录。
Package: pyasmtools
Pyasmtools - looking at the python bytecode for fun and profit.The pyasmtools library is made up of two partsA python bytecode disassembler . SeePython bytecode explainedA tracer for python, that displays the source code of each executed line, along with the variables loaded and stored. SeeExecution traces in PythonNote that some of the goodness in this library is cpython specific, i don't expect it to work on every python based environment.InstallationYou can install this library withpip3 install pyasmtools. Instructions are in the above mentioned links.
Package: pyasn1-fasder
pyasn1-fasderpyasn1-fasder is a DER decoder for pyasn1 with a focus on checking the correctness of encoding. This decoder is more pedantic than most other decoders in terms of flagging DER
encoding errors, and this behavior is unlikely to change.Installationpip install pyasn1-fasderUsagepyasn1-fasder exposes a single function:decode_der. The signature and return type are the same as the pyasn1decodefunction, as it is intended to be a drop-in replacement ofpyasn1.codec.der.decoder.decode.frompyasn1.type.charimportPrintableStringfrompyasn1_fasderimportdecode_dersubstrate=b'\x13\x03\x41\x42\x43'decoded,rest=decode_der(substrate,asn1Spec=PrintableString())assertrest==b''assertstr(decoded)=='ABC'LimitationsThere is no encoding counterpart.Trailing octets present after thesubstrateTLV are not tolerated and will result in an exception being raised. In other words, therestcomponent of the tuple return value will always be an emptybytesobject.Schemaless decoding is not supported. In other words, a non-Noneasn1Specmust be passed todecode_der.Sets withnamedValuesare not supported. These are (almost?) never used in cryptography standards, but support can be added if there are valid use cases.openTypesdecoding is currently not supported. This can be added if there is interest.The pedantic checks for correctness of encoding cannot be disabled.Bugs?Please create a Github issue.ContributingContributions for bug fixes and new features are welcome.
Package: pyasn1-ldap
Python module to decode ASN1 stream of LDAP message using pyasn1Installpip install pyasn1_ldapUsage#!/usr/bin/python
from pyasn1.codec.ber.decoder import decode as ber_decoder
from pyasn1_ldap import rfc4511

hex_text = '302f020101602a020103041a41646d696e6973747261746f72404558414d504c45322e434f4d800950617373773072642e'
substrate = bytes.fromhex(hex_text)
ldap_message, rest = ber_decoder(substrate, asn1Spec=rfc4511.LDAPMessage())
print(ldap_message)

# the output should be:
# LDAPMessage:
#  messageID=1
#  protocolOp=Choice:
#   bindRequest=BindRequest:
#    version=3
#    name=Administrator@EXAMPLE2.COM
#    authentication=AuthenticationChoice:
#     simple=Passw0rd.ThanksThanks topyasn1for implementing ASN.1 types and codecs.Thanks toasn1atefor implementing ASN.1 translation library.
Package: pyasn1-modules
ASN.1 modules for PythonThepyasn1-modulespackage contains a collection ofASN.1data structures expressed as Python classes based onpyasn1data model.If ASN.1 module you need is not present in this collection, try usingAsn1atetool that compiles ASN.1 documents
into pyasn1 code.NOTE:The package is now maintained byChristian HeimesandSimon Pichuginin projecthttps://github.com/pyasn1/pyasn1-modules.FeedbackIf something does not work as expected,open an issueat GitHub
or post your questionon Stack OverflowNew modules contributions are welcome via GitHub pull requests.Copyright (c) 2005-2020,Ilya Etingof.
All rights reserved.
Package: pyasn1-modules-lextudio
ASN.1 modules for PythonThepyasn1-modulespackage contains a collection ofASN.1data structures expressed as Python classes based onpyasn1data model.If ASN.1 module you need is not present in this collection, try usingAsn1atetool that compiles ASN.1 documents
into pyasn1 code.FeedbackIf something does not work as expected,open an issueat GitHub
or post your questionon Stack OverflowNew modules contributions are welcome via GitHub pull requests.Copyright (c) 2005-2020,Ilya Etingof.
All rights reserved.
Package: py-asoc
Appscan on Cloud Python APIGenerated initially from Appscan on Cloud (
ASOC)swagger spec, added various functionality and
CLI interface.CLIInstallRequirementsASOC CLI on the pathhttps://help.hcltechsw.com/appscan/ASoC/src_utility_install.htmlNode.js >= 14 if you want the ability to generate badgeshttps://nodejs.org/en/downloadAlso, prefer to pre-install badge-maker:npm install badge-makerpipinstallpy-asoc# or for badgespipinstallpy-asoc[badges]RunUsage: asoc [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options:
  -a, --app_id TEXT      ASOC App ID  [required]
  -k, --key_id TEXT      ASOC Key ID  [required]
  -s, --key_secret TEXT  ASOC Key Secret  [required]
  -n, --scan_name TEXT   Scan Name  [default: main]
  -h, --help             Show this message and exit.

Commands:
  num-issues-badge
  scan
  status-badge
  upload-external
  waitscancreates an IRX package and uploads it to ASOC, then either creates a new scan or starts an existing
one.upload-externalUploads any json files in the givven directory to ASOC as external issues.waitwaits for the scan to finish.status-badgegenerates a badge for the application risk levelnum-issues-badgegenerates a badge for the number of unresolved issues for the application
Package: pyaspeller
Python text spellerpyaspeller(Python Yandex Speller) is a cli tool and pure python library for searching typos in texts, files and websites.Spell checking usesYandex.Speller API. (restrictions)FeaturesCommand line toolYou can correct your local files or web pages$pyaspeller./doc
$pyaspellerhttps://team-tricky.github.io
$pyaspeller"в суббботу утромъ"всубботуутромLibraryUse speller for your code>>>frompyaspellerimportYandexSpeller>>>speller=YandexSpeller()>>>fixed=speller.spelled('Triky Custle is a great puzzle game.')>>>fixed'Tricky Castle is a great puzzle game.'You can use classWordfor single word queries:>>>frompyaspellerimportWord>>>check=Word('tesst')>>>check.correctFalse>>>check.variants[u'test']>>>check.spellsafeu'test'InstallationUse your favourite package manager:$python3-mpipinstallpyaspellerAlso, there are availablerustandjavascriptversions of this speller.
Package: py-aspsms
aspsms (www.aspsms.com) is a Swiss company that offers SMS gateway
services for a fair price. Py-aspsms is a Python interface for this
service. Currently, only basic operations are supported (e.g. sending
a simple SMS or getting information about the remaining credit) but I
am currently extending it. If you have specific neeeds (e.g. sending a
ringtone or an operator logo) just put your request on the issue tracker
or send me an e-mail.
Package: pyasr
PyASRAncestral Sequence Reconstruction in PythonPyASR offers a modern Python interface toPAML("Phylogenetic Analysis by Maximum Likelihood")--tuned specifically for reconstruction
ancestral protein/DNA sequences.NOTE:PyASR currently only supports protein reconstructions. This is a work in progress.Basic Usageimportphylopandasaspdimportdendropyasdimportpyasr# Use phylopandas to read a set of ancestor.sdf_seqs=pd.read_fasta('test.fasta')# Use dendropy to read in tree.tree=d.Tree.get(path='tree.newick',schema='newick')# Reconstruct nodes in tree.tree,df_seqs,df_anc=pyasr.reconstruct(df_seqs,tree,working_dir='test',alpha=1.235)# Write out ancestor dataframe to a CSV file.df_anc.to_csv('ancestors.csv')We can visualize the ancestors side-by-side with the tree using inside of JupyterLab
thanks to the ToyTree library.InstallThis package is released on PyPi. You can install using pip:pip install pyasrTo get the development version:git clone
cd
pip install -e .DependenciesThe actual reconstruction calculation are done usingPAML. This requires PAML to be
installed and thecodeml/basemlexecutables exported to your$PATHenvironment variable. Directions for installing PAML can be found on the PAML website.The following Python dependencies are required for PyASR to work.PandasBiopythonPhyloPandasDendroPy
Package: pyassemble
pyassemble is a tool of package python code libs and dependencies for offline installation. pyassemble implements an project build process like maven assemblyGet StartedInstall pyassemblepipinstallpyassemblesetup.pyexamplefromsetuptoolsimportfind_packages,setupfrompyassemble.packageimportPackagesetup(name='pyassembly_example',author="chaokunyang",version='1.0',description='assemble project with all dependencies for install offline',long_description=open('README.rst').read(),classifiers=['Programming Language :: Python :: 3.6','Intended Audience :: Developers',],keywords='assembly pyassemble dist offline install dependencies',url='http://github.com/chaokunyang/pyassemble/example',license='Apache License 2.0',packages=find_packages(),include_package_data=True,zip_safe=False,cmdclass={"package":Package})Packagepythonsetup.pypackageInstallInstall dependenciespipinstall-rrequirements.txt--no-index--find-linkswheelhouseInstall project packagepipinstall.OthersYou can do it manually:Download libs
.. code-block:: bashpip download django -d wheelhouse
pip download -r requirements.txt -d wheelhouseInstall libs
.. code-block:: bashpip install -r requirements.txt –no-index –find-links wheelhouse
Package: pyassembly
PyAssemblypyassembly is the Python setup.py command. If you are familiar with fat or uber jar, than this command will come as no surprise for you. By installing and using it, you will get an "uber" egg or zip file, which will contain not only your project, but will also include all the dependencies you specified in you requirements.txt file, including the dependence of the dependencies (a.k.a. transitive dependencies), making it easy to create a self-contained distribution.Installing.. code-block:: shell$ pip install pyassemblyAlternatively, you can include it into your requirements.txt file.How to useExample for using the tool.. code-block:: shell$ python setup.py pyassemblyHow to get more optionsAfter you installed the command you can get the list of options.. code-block:: shell$ python setup.py pyassembly --helpReporting IssuesIf you have suggestions, bugs or other issues with this command - please open an issue or make a pull request.
Package: py-assembly
py_assembly is a tool of package python code libs and dependencies for offline installation. py_assembly implements an project build process like maven assemblyGet StartedInstall py_assemblypipinstallpy_assemblysetup.pyexamplefromsetuptoolsimportfind_packages,setupfromassembly.packageimportPackagesetup(name='py_assembly_example',author="chaokunyang",version='1.0',description='assemble project with all dependencies for install offline',long_description=open('README.rst').read(),classifiers=['Programming Language :: Python :: 3.6','Intended Audience :: Developers',],keywords='assembly dist offline install dependencies',url='http://github.com/chaokunyang/py_assembly/example',license='Apache License 2.0',packages=find_packages(),include_package_data=True,zip_safe=False,cmdclass={"package":Package})Packagepythonsetup.pypackageInstallInstall dependenciespipinstall-rrequirements.txt--no-index--find-linkswheelhouseInstall project packagepipinstall.OthersYou can do it manually:Download libs
.. code-block:: bashpip download django -d wheelhouse
pip download -r requirements.txt -d wheelhouseInstall libs
.. code-block:: bashpip install -r requirements.txt –no-index –find-links wheelhouse
Package: py-assembly-payments
py-assembly-paymentsUnofficial Python client for the Assembly Payments API🚧 In Development 🚧This package is still undergoing development and is pre-v1. It currently implements around 30% of the Assembly Payments API. You can keep up with thecoverage hereInstallationpip install py-assembly-paymentsExamplefromassembly_payments.clientimportAssemblyClientclient=AssemblyClient(client_id=CLIENT_ID,client_secret=CLIENT_SECRET)# List Usersclient.users.list()# Create Useruser=client.users.create(id="your-user-id",first_name="Jane",last_name="Doe",email="jane.doe@example.com")# Easy object accessprint(user.first_name+user.last_name)# Jane DoeCredentialsYou can set your auth credentials in two ways:Through arguments to the client:AssemblyClient(client_id=CLIENT_ID,client_secret=CLIENT_SECRET,scope=CLIENT_SCOPE,grant_type="client_credentials")Through environment variable whichAssemblyClientwill pick up from:exportASSEMBLY_CLIENT_ID=my-client-idexportASSEMBLY_CLIENT_SECRET=my-client-secretexportASSEMBLY_SCOPE=my-scopegrant_typedefaults to"client_credentials"and can only be controlled by an argument toAssemblyClient.
Package: pyassert
pyassert is an assertion library for the Python programming language.IntroductionAssertions are used in automated tests to verify that a given piece of code behaves as expected. pyassert aims to provide assertions with providerich functionality: common assertions should be expressed easilygood readability: assertions should be easy to read and easy to understand to enhance the overall understandability of the testindependent of the test framework: pyassert assertions work with every Python test environment.How to install it?pyassert is available via the [Cheeseshop](http://pypi.python.org/pypi/pyassert/) so you can use easy_install or pip:$ pip install pyassertLinkspyassert Github repository including documentation <https://github.com/pyclectic/pyassert>
Package: pyasset
PyAssetpython library supporting builder, and more (to be updated)1. BuilderBuilder DecoratorIf you want to apply thebuilder patternto your custom class, follow these steps:load code usingfrom builder import builderPlace the desired variables in the class constructor function (definit(self)).Attach the@builderdecorator at the top of the class.Done.# For examplefrompyassetimportbuilder@builder()classA:def__init__(self):self.name=str()self.age=0If you've written the builder decorator but don't want to apply the builder pattern, simply avoid appending.builder()!The instance will be created following the existing__init__function.a=A()# you can use A.builder()---a.name# ""a.age# 0frompyassetimportbuilder# It also provides several options.# 1. use decorator only @builder()#  - non-check type#  - last method is .build()#  - default method use : ex) CLASS.builder().name("NAME")@builder()classMyClass:def__init__(self):self.integer=32self.string="Undefined"def__str__(self):returnstr(self.integer)+", "+self.stringobj=MyClass.builder().integer(64).build()# 2. use decorator @builder() with some options.#  - non-check type#  - last method is .run()#  - prefix method use : ex) CLASS.builder().set_name("NAME")@builder(build_method_name="run",setter_prefix="set_")classSecondMyClass:def__init__(self):self.ready=bool(False)self.initial_speed=float()def__str__(self):return"speed : "+str(self.initial_speed)ifself.readyelse"not ready."vehicle1=SecondMyClass.builder()vehicle1.set_ready(True)vehicle1.set_initial_speed(0.5)vehicle1.run()vehicle2=SecondMyClass.builder().set_initial_speed(2023).run()# 3. use decorator @builder() with type_check.#  - check type, if not matched type? raise TypeError#  - Of course, it can be combined with other options@builder(type_check=True)classThirdMyClass:def__init__(self):self.integer=int()self.float=float()self.string=str()self.boolean=bool()obj=ThirdMyClass.builder()obj.integer(1)# errorobj.float("MAKE ERROR")Debugging mode for builder# if you want checking target of builder classclassBuilderPattern:...def__str__(self):returnf"{<CLASS>.__name__}builder"def__repr__(self):returnf"{<CLASS>.__name__}builder,{<PARAMETERS>}"# you can use str(<BUILDER_CLASS>) return <TARGET> builder.# and use repr(<BUILDER_CLASS>) retrun <TARGER> builder, and <KEY: VALUE> maps.CANT USE.2. Percentage Bar (Under Improvement)bar# print colored bar in terminal.# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━frompercentage.captionsimportPercentageValueCaption,PercentageTinyTimeSpanCaptionfrompercentage.barimportBarPercentagefromtimeimportsleep# make percentage bar from 0 to 100.bar=BarPercentage(0,100)# caption - print value like [1/100].bar.add_caption(PercentageValueCaption)# caption - print time like 0.42 s.bar.add_caption(PercentageTinyTimeSpanCaption)for_inrange(100):sleep(0.05)# percentage += 1bar.add_value(1)# print percentage barbar.update()# clear bar state ( value, captions data )# but, not "\n" printbar.clear()print()# print bar 50%bar=BarPercentage(0,100)for_inrange(50):bar.add_value(1)bar.update()# print bar 75% (and from 0 to 4)bar=BarPercentage(0,4)bar.add_value(3)bar.update()