Saravanan666/pypi-org huggingface dataset:
Package: py21
Blackjackpy21is a blackjack simulator. Users can run the simulation using the
default rules or specify their own. Additionally, users can test their own
playing and betting strategies.InstallationRight nowpy21can be installed from source or PyPI.To download from source, clone or download this
repository, then navigate to the directory you cloned to and runpip install -e ..To download from PyPI, usepip install py21Usingpy21To run the simulator, the user must initiate one instance of theGameclass
and at least one instance of thePlayerclass.ThePlayerclass requires one input,bankroll, and has three optional inputs:strategy_func,wager_func, andinsurance_func.bankrollshould be an numerical value indicating the bankroll
the player will be starting with.strategy_funcshould be a function that will
return what action the player will take in a given situation. This function
can take as inputs a number of variables containing information about the game
such as the player's hand, dealer's up card, and the count. It must return one
of the following:HIT,STAND,SPLIT,DOUBLE.wager_funcshould be a function that will determine how much the player will
wager in a hand. Like the function used forstrategy_funcit can take as
arguments variables on the status of the game. It must return a number that is
within the minimum and maximum bets allowed, and no more than the player's
bankroll.insurance_funcshould be a function that will determine if a player takes
insurance when the dealer is showing an ace. It must returnTrueorFalse.TheGameclass has one required argument and two optional ones.playersis a list of instances of thePlayersclass that will be used in the game.rulescan be a dictionary containing changes to the game's default rules to
run the simulation under different scenarios. An explanation of how the
dictionary should be structured is below. Finally,verboseis a boolean
indicator for whether or not you want information printed out as the game is
played.Running a simulation can be done in a few lines of code:frompy21importGame,Player# initiate Player objectplayer=Player(100)# initiate Game objectgame=Game([player])# run simulation 1,000,000 timesgame.simulate(1000000)Updating Game ParametersTo update a rule in the game, use this dictionary format:{param: new_rule}For example, here is how to change the blackjack payout from 3:2 to 6:5:frompy21importGame,Playerrules={"blackjack_payout":1.2}player=Player(100)game=Game([player],rules)game.simulate(1000000)A list of the game parameters you can update can be foundhere.As of version 1.6.0, there is also a CLI forpy21. To use it, runblackjackfrom the command line.
Package: py21cmcast
21cmCASTThis package provides tools to perform Fisher foreCASTs from 21cmFAST outputs. It has been built on / complementarily to the21cmFishpackage[^1]. A detailed example of how it works can be found inscripts/exec/fisher.ipynb.In order to work properly, the codes requires to have a working installation of21cmFAST[^2][^3]21cmSense[^4]If you are considering using this code, please cite the following work for which it has been developpedG. Facchinetti, L. Lopez-Honorez, Y. Qin, A. Mesinger, 21cm signal sensitivity to dark matter decay[arXiv:2308.16656]InstallationIn order to install the code you can install it with pip runningpip install py21cmcastIn order to use and modify the code clone this repository and runpip install -e .in the main folder.Quick start guideExamples onOngoing workTo do list:rearrange the code in a self-contained packageuniformely use astropy units throughout the entire codeadd docstrings to the classes[^1]:Charlotte A. Mason, Julian B. Muñoz, Bradley Greig, Andrei Mesinger, and Jaehong Park, 21cmfish: Fisher-matrix framework for fast parameter forecasts from the cosmic 21-cm signal[arXiv:2212.09797][^2]:Andrei Mesinger, Steven Furlanetto, and Renyue Cen, 21cmFAST: A Fast, Semi-Numerical Simulation of the High-Redshift 21-cm Signal[arXiv:1003.3878][^3]:Andrei Mesinger and Steven Furlanetto, Efficient Simulations of Early Structure Formation and Reionization[arXiv:0704.0946][^4]:Jonathan C. Pober, Adrian Liu, Joshua S. Dillon, James E. Aguirre, Judd D. Bowman et al., What Next-Generation 21 cm Power Spectrum Measurements Can Teach Us About the Epoch of Reionization[arXiv:1310.7031]
Package: py21cmEMU
An emulator of 21cmFAST summaries.Emulate the following summary statistics:21-cm power spectrum21-cm global brightness temperatureIGM spin temperatureNeutral fractionThomson scattering optical depthUV luminosity functionsDocumentationSeethe documentationfor tutorials and API.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.ContributingContributions are very welcome.
To learn more, see theContributor Guide.CitationIf you use21cmEMUin your research, please citeBreitman+23.LicenseDistributed under the terms of theMIT license,21cmEMUis free and open source software.CreditsThis project was generated from@cjolowicz’sHypermodern Python Cookiecuttertemplate.
Package: py21cmfish
A python package for doing Fisher matrix analysis with21cmFAST.DependenciesThe main dependency is21cmFAST.
Istronglyrecommend you install21cmFASTfirst.DocumentationSeehttps://21cmfish.readthedocs.iofor API documentation and a usage tutorialAcknowledgingIf you find21cmfishuseful in your research please cite:Mason et al. 2022 (submitted)
Package: py23
Library py23Python 2/3 compatible functionsInstallation$pipinstallpy23Usageimportosfrompy23importload_module_by_pathpy_module=load_module_by_path(os.path.join('py23','__init__.py')assertcallable(py_module.remove_symbols)Development$ git clone git@github.com:vb64/py23.git
$ cd py23With Python 3:$ make setup PYTHON_BIN=/path/to/python3
$ make testsWith Python 2:$ make setup2 PYTHON_BIN=/path/to/python2
$ make tests2
Package: py25519
py25519Python wrapper around curve25519 by mehdi sotoodeh. The files under
py25519/c are from mehdi sotoodeh and are copied unchanged fromhttps://github.com/msotoodeh/curve25519.LICENSEThe files under py25519/c are licensed under the MIT LICENSE (see
license.txt file under py25519/c).All remaining files in this package are licensed under the GNU General
Public License version 3 or (at your option) any later version.See the file LICENSE-GPLv3.txt for details of the GNU General Public
License version 3.Class Documentationclass Key25519(__builtin__.object)
      __init__(self, secretkey=None, verifyingkey=None, pubkey=None)
        '''
          secretkey-->bytes[32]
            verifyingkey-->bytes[32]
          pubkey-->bytes[32]

          A PublicKey version of the object will have ONLY verifyingkey
          and pubkey and signingkey will be None
          A PrivateKey version of the object will have secretkey set
          and verifyingkey and pubkey are ignored and derived from secretkey

          Storing and reusing the secretkey is a way to recreate your key pair
        '''

      get_ecdh_key(self, other)
        '''
          other-->Key25519 instance
        '''

      public_key(self)
        '''
          Returns a PublicKey version of this object
        '''

      selftest(self)
        '''
          Returns-->boolean
        '''

      serialize(self)

      sign = wrapped(*args, **kwargs)

      verify = wrapped(*args, **kwargs)

      # ---------------------------------------------------------------------
      # Properties (data descriptors)
      # ---------------------------------------------------------------------

      pubkey

      secretkey

      signingkey

      verifyingkeySimple testsee py25519.test.pyfrom py25519 import Key25519


c = Key25519()
print('secretkey: ', c.secretkey)
print('signingkey: ', c.signingkey)
print('verifyingkey: ', c.verifyingkey)

msg = 'Hello world'
badmsg = msg + '1'
sig = c.sign(msg)
badsig = c.sign(badmsg)
print('good verify: ', c.verify(sig, msg))
print('badmsg verify: ', c.verify(sig, badmsg))
print('badsig verify: ', c.verify(badsig, msg))

d = Key25519(secretkey=c.secretkey)
print('----- d is a copy of c -----')
print('d.verify: ', d.verify(sig, msg))
print('c == d:', c == d)
print('public(c) == public(d):', c.public_key() == d.public_key())
print('c == public(d):', c == d.public_key())

print('----- e is a new different key -----')
e = Key25519()
print('e.verify: ', e.verify(sig, msg))
print('c == e:', c == e)
print('public(c) == public(e):', c.public_key() == e.public_key())

print('----- Test ECDH shared key -----')
ecdh1 = c.get_ecdh_key(e.public_key())
ecdh2 = e.get_ecdh_key(c.public_key())
print('ecdh equal: ', ecdh1 == ecdh2)
ecdh3 = e.get_ecdh_key(c.public_key())
print('ecdh equal again: ', ecdh1 == ecdh3)
Package: py2700
Unofficial Keithley 2700 Series DMM Interface: py2700A Python package to interface with a Keithley 2700 digital multimeter.IntroductionThe py2700 package is designed to allow for easy access to common SCPI commands sent to the multimeter. From setting up channels, to reading data, to even writing to the display, the package allows the user to quickly and easily produce working, readable Python code to collect data from their device, and ultimately avoid being forced to pay for a license for Keithley Kickstart.Documentation is available at:https://www.noahpaladino.com/py2700/Example Programimportpy2700asDMMimporttime# Connect to a Keithley 2701 over TCP/IPmy_multimeter=DMM.Multimeter('TCPIP::192.168.69.102::1394::SOCKET')# Set the default temperature unitsmy_multimeter.set_temperature_units('C')# Set the timeout in msmy_multimeter.set_timeout(5000)# Set Channels 101, 102, and 103 as K-type thermocouplesmy_multimeter.define_channels([101,102,103],DMM.MeasurementType.thermocouple('K'))# Setup for reading:#   This needs to be completed after channel#   definitions and before scanningmy_multimeter.setup_scan()# Scan the channels, given the timestamp you want# for the readingresult=my_multimeter.scan(time.time_ns()/(10**9))# Print out a CSV header for the resultprint(my_multimeter.make_csv_header())# Print out a CSV row for the resultprint(result.make_csv_row())# Safely disconnect from the multimetermy_multimeter.disconnect()ContactPlease submit an issue if you encounter a bug and please email any questions or requests topy2700@noahpaladino.com
Package: py2annotate
An extension to Sphinxautodocto augment Sphinx documentation with type annotations, when using Python 2 style type annotations.The ProblemPython 2 doesn’t support type annotations. Thus writing Python 2 / Python 3 agnostic code with type annotations requiresputting the type annotations in comments:defadd(x,y):# type: (int, int) -> int"""Adds two numbers."""returnx+yBut now when documentation is generated withSphinx, the documentation doesn’t include type annotations:Example from theSignatoryproject.The SolutionThis extension remedies things so that the Sphinx documentation now looks like:(which is the same as what you’d get using Python 3 style type annotations e.g.defadd(x:int,y:int)->int)InstallationVia pip:pipinstallpy2annotateIt’s also just a single file, so copy-paste the code if you want.Requires Python 3.6+.UsageJust add py2annotate to the list of extensions inconf.py:# conf.py...extensions=['sphinx.ext.autodoc','py2annotate']...(It shouldn’t matter whether it comes before or afterautodoc.)Note that Sphinx itself must be run using Python 3.6+. This is because py2annotate uses the Python 3 style type
annotations internally in order to determine the correct annotations.Known IssuesNone so far! File a report if you run into anything.mypyandstubgenare used internally though, so your code’s formatting must be in a manner that they understand.
Package: py2appsigner
RationaleThese utilities help me sign Python applications built with py2app.  This project is a Python rewrite of the one I implemented
usingBashscripts.  See
theCodeSigningScriptsrepository.  The source article for this code and
the shell scripts is stillhere.  The
motivation to do this in Python was that supporting different Python versions necessitated implementing version specific scripts
when signing the Python libraries and applications.  I thought that was unsustainable.The goals for this project are:Consistent CLI interface across Python versionsInstallable in a developer's virtual environmentDefault the signing parameters to environment variables.  This allows for short CLI invocations.  However, still allow CLI parameter overridesUse the built-in keychain to store the notarization tool application ID.  This avoid having to either key-in or recall from the bash history a long, long application ID.DependenciesThis project usesClickfor CLI handlingRequired Environment VariablesThe above commands depend on the following environment variables.PROJECTS_BASE-Thelocaldirectorywherethepythonprojectsarebased
PROJECT-Thenameoftheproject;Itshouldbeadirectoryname
IDENTITY-YourAppleDeveloperIDAn example, of a PROJECTS_BASE is:exportPROJECTS_BASE="${HOME}/PycharmProjects"This should be set in your shell startup script.  For example.bash_profile.The PROJECT environment variable should be set on a project by project basis.  I recommend you usedirenvto manage
these.  An example of a .envrc follows:exportPROJECT=pyutmodelsourcepyenv-3.10.6/bin/activatePython Console ScriptsSign the internal zip filepy2appSign --python-version 3.11 --project-directory pyut --application-name Pyut  --verbose zipsignSign the applicationpy2appSign -p 3.11 -d pyut -a Pyut  --verbose appsignNotarize the applicationappNotarize -d pyut -a Pyut --verboseStaple the applicationappStaple -d pyut -a Pyut --verboseVerify application signingappVerify -d pyut -a PyutUtility ScriptsNotarization HistorynotaryTool historySpecify a profile namenotaryTool -p NOTARY_TOOL_APP_ID historyStores the history in the filenotaryHistory.log.Notary DetailsnotaryTool information -i <submission id) e.g. 5f57fc1e-23d3-42ab-b0ad-ec1d2635c4adSpecify a profile namenotaryTool -p NOTARY_TOOL_APP_ID information -i <submission id> e.g.  5f57fc1e-23d3-42ab-b0ad-ec1d2635c4adStores the output in the filenotary-{submission id}.logWritten byHumberto A. Sanchez II(C) 2023NoteFor all kind of problems, requests, enhancements, bug reports, etc.,
please drop me an e-mail.I am concerned about GitHub's Copilot projectI urge you to read about theGive up GitHubcampaign fromthe Software Freedom Conservancy.While I do not advocate for all the issues listed there I do not like that a company like Microsoft may profit from open source projects.I continue to use GitHub because it offers the services I need for free.  But, I continue to monitor their terms of service.Any use of this project's code by GitHub Copilot, past or present, is done without my permission.  I do not consent to GitHub's use of this project's code in Copilot.
Package: py2captcha
Py2captchaClient library to solve captchas with 2captcha.com support.Getting StartedInstall as a standard Python package using:pip install py2captchaUsagefrom py2captcha import TwoCaptchaClient, GoogleReCaptchaV2Task
    
    # 2captcha.com authentication key
    key = "Your key goes here"

    # Website data
    google_key = "Google recaptcha key"  # sitekey
    url = "http://site.com/captchaurl"
    
    # Create client
    client = TwoCaptchaClient(client_key=key)

    # Requesting 2captcha.com queue status for reCAPTCHA V2
    status = client.get_queue_stats()

    print("reCAPTCHA V2 queue status:")
    print("Total workers: %d" % status.workers_total)
    print("Free workers: %d" % status.free_workers)
    print("Load factor: %d%%" % status.load)
    print("Average solve speed: %d seconds" % status.speed)
    print("Price per 1000 CAPTCHAS: %f USD" % status.bid)

    # Create Recaptcha Task
    task = GoogleReCaptchaV2Task(googlekey=google_key, pageurl=url)
    job = client.create_task(task)

    # Wait until captcha is solved
    # For async runs just call job.check_is_ready() until it returns true
    job.join()

    # Result
    token = job.get_solution_response()

    # Cost (Always 2.9/1000)
    cost = job.get_solution_cost()

    # Base 5 solution time
    time = job.get_solution_time()

    print("Token: %s" % token)
    print("Cost: %f USD" % cost)
    print("Solve time: %d seconds" % time)Supported CAPTCHA typesreCAPTCHA V2
Package: py2casefold
py2casefoldPython 3 hasstr.casefold().  Python 2 doesn’t.py2casefoldbrings casefolding support to Python 2.Installationpip install py2casefoldUsage>>> from py2casefold import casefold
>>> print casefold(u"tschüß")
tschüss
>>> casefold(u"ΣίσυφοςﬁÆ") == casefold(u"ΣΊΣΥΦΟσFIæ") == u"σίσυφοσfiæ"
TrueNote thatcasefolddoesnotnormalize the string.  Casefolding and
normalization are different operations.  For more info seehttp://www.w3.org/International/wiki/Case_folding, andhttp://www.w3.org/TR/charmod-norm/.If you are looking for string similarity you will also probably want to
consider one of the unicode normalization options (NFC, NFKC, NFD, NFKD)
that are available with Python’s built inunicodedata.normalize().SpeedAt the moment, this pure Pythoncasefoldimplementation is
significantly (> 20x) slower than the optimized py3 C implementation.
This can be improved later, but it is currently more than sufficient
for basic case folding.  As a rough estimate, case folding 100
characters clocks in at ~25μs on an old developer laptop.TestsTo run the tests on all supported Python version simple use tox.toxYou will need to have Python 2.7, Python 3.4, Python 3.5 and Python 3.6 installed.LicenseBSD and the Unicode license agreement.  This module includes data from
the Unicode consortium which should include the appropriate notice (seehttp://unicode.org/copyright.html).SeeLICENSEfile for details.
Package: py2curl
py2curl将 python 的 requests 代码转换成 curl 命令安装pipinstallpy2curl使用importrequestsimportpy2curlreq=requests.get('https://tendcode.com')result=py2curl.render(req.request)print(result)### curl -k -v -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate" -H "Connection: keep-alive" -H "User-Agent: python-requests/2.19.1" https://tendcode.com/
Package: py2dmat
2DMAT -- Data-analysis software of quantum beam diffraction experiments for 2D material structure2DMAT is a framework for applying a search algorithm to a direct problem solver to find the optimal solution.
As the standard direct problem solver, the experimental data analysis software for two-dimensional material structure analysis is prepared.
The direct problem solver gives the deviation between the experimental data and the calculated data obtained under the given parameters such as atomic positions as a loss function used in the inverse problem.
The optimal parameters are estimated by minimizing the loss function using a search algorithm.
For further use, the original direct problem solver or the search algorithm can be defined by users.
2DMAT offers wrappers of direct problem solvers for some of quantum beam diffraction experiments such as the total-reflection high-energy positron diffraction (TRHEPD) experiment.
As algorithms, it offers some minimizers such as the Nelder-Mead method and some samplers such as the population annealing Monte Carlo method.
In the future, we plan to add other direct problem solvers and search algorithms in 2DMAT.BranchBuild statusDocumentationmaster(latest)v2.1.0(latest stable)--py2dmatpy2dmatis a python framework library for solving inverse problems.
It also offers a driver script to solve the problem with predefined optimization algorithms
and direct problem solvers (py2dmatalso means this script).PrerequistsRequiredpython >= 3.6.8numpy >= 1.14tomli >= 1.2.0Optionalscipyforminsearchalgorithmmpi4pyforexchangealgorithmphysbo >= 1.0forbayesalgorithmInstallFrom PyPI (Recommended)python3 -m pip install -U py2dmatIf you install them locally, use--useroption likepython3 -m pip install -U --userpipxmay help you from the dependency hell :pFrom Source (For developers)updatepip >= 19bypython3 -m pip install -U pippython3 -m pip install 2DMAT_ROOT_DIRECTORYto installpy2dmatpackage andpy2dmatcommand2DMAT_ROOT_DIRECTORYmeans the directory including thisREADME.mdfile.Simple Usagepy2dmat input.toml(use the installed script)python3 src/py2dmat_main.py input.toml(use the raw script)For details of the input file, see the document.Files and directories of 2DMATsrc/source codesscript/utility scriptssample/sample usagesdoc/source codes of documents (manuals)tests/for automatic testLICENSElicense terms (GNU GPL v3)README.mdthis filepyproject.tomlmetadata forpy2dmatLicenseThis package is distributed under GNU General Public License version 3 (GPL v3) or later.Copyright©2020- The University of Tokyo. All rights reserved.This software was developed with the support of "Project for advancement of software usability in materials science" of The Institute for Solid State Physics, The University of Tokyo.
Package: py2edw
py2edwA high level Python wrapper for remotely connecting to SQL databases and querying using pandas dataframes.SQL commands can be executed using the SQL operator.All queries input and outout using pandas dataframes.Optional ssh tunnel connectionConnectors:postgresqlmysqlImport:from py2edw import postgresql, mysqldb  & ssh parameter format:db_params = {"database": <db_name>, "user": <username>, "password": <password>, "host": <host>}ssh_params = {"ssh_ip": <ip_address>, "ssh_port": <port>, "ssh_username": <username>, "ssh_password": <password>, "remote_bind_ip": <local_ip>, "remote_bind_port": <local_port>}Sample code:py2edw = mysql.py2edw(db_params, ssh_params=False)py2edw.import_DataFrame("select * from table_name")Avaliable operators:sqlimportinsertupsertstart connectionclose connectionshow tablespy2edw.help()for details
Package: py2emap
py2emappy2emap is a module that converts Python objects to Emap.Emapis designed to be useful for exchange data betweenNeos VRand external applications.Installation$pipinstallpy2emapHow to use?importpy2emappydata={"name":"John","age":30,"address":{"street":"Main Street","city":"New York","state":"NY"}}string=py2emap.dumps(pydata)print(string)# =># l$#5$#v$#k0$#name$#v0$#John$#t0$#string$#k1$#age$#v1$#30$#t1$#number$#k2$#address.street$#v2$#Main Street$## t2$#string$#k3$#address.city$#v3$#New York$#t3$#string$#k4$#address.state$#v4$#NY$#t4$#string$#Also, you can convert json to emap in command line.$python-mpy2emap'{"key1": "value1", "key2":"value2"}'l$#2$#v$#k0$#key1$#v0$#value1$#t0$#string$#k1$#key2$#v1$#value2$#t1$#string$#It can take stdin.$echo'{"key1": "value1", "key2":"value2"}'|python-mpy2emap-
l$#2$#v$#k0$#key1$#v0$#value1$#t0$#string$#k1$#key2$#v1$#value2$#t1$#string$#By bringing these converted strings into Neos, objects can be easily restored and handled through LogiX.
Please see theproposer's repositoryfor more details on how to handle this in Neos.
Package: py2exe-converter
The package allows users (linux) to convert python scripts into executable files by simply using the py2exe-converter -f <python-file-name.py>.One can also use another option after entering python filename which is -p for packages to be included into the executable file. -p takes requirement.txt as input. I have included an example in the demo folder as well. Enjoy! And yup, please, do come forward if you think you can improve or add more functionalities to the project :).
Lastly, a huge shoutout to pyinstaller developers who made such an incredible solution that provided a solid base to this project. Thanks amigos!
Package: py2flowchart
py2flowchartGenerates flowchart from Python functions and python file.让简单的Python函数或文件生成流程图。（流程图可用flowchart.js来显示，也可以用于typora等md文件中）（在typora中用flow.....表示流程图）Examplesfrompy2flowchartimport*pyfile2flowchart("xxxx.py","xxxx.html")pyfile2flowchart("xxxx.py","xxxx.html",{"line-width":1,"arrow-end":"open"})get_flowchart("if a>b:\nprint(c)")defmyfun():passget_flowchart(myfun)FAQsWhich Python version? ... Using 3.x AST.This prog is very limited, it can use for "if,for,while" statement, but not for "break,continue"Thanksthis programe was inspired bylatexify_pyaboutdstang2000@263.net