Saravanan666/pypi-org huggingface dataset:
Package: bammm-ozika
bambimodelmanagement (bammm)Estimating complex models can take time.bammmallows one to save estimated models and to later load them as required (without the need to re-estimate them).Currently it is build to only work with (generalized) linear models in python that have been esimtated usingbambibut in essence it can be used to save samples from anyPyMCmodel.FunctionalityCreation and mangement of database of local models (simple JSON file)Model (dependent variable, fixed and random effects) and estimation parameters (no chains, samples/chain, cores) specification.Automatic build of regression equation (input to bambi) usingmm.geerate_equation()Model estimation usingmm.estimate_lmm()Saving (mm.save_model_info()) and updating (mm.update_model_entry()) of estimated model information.Loading previously esimtated model (mm.estimate_lmm())UsageSetupInstall using pip:pipinstallbammm-ozikaLoadimportbammm.bammmasmmFull example script can be foundhere.Generate your local JSON databaseBefore first use on a project a local database needs to be generated. Specify a path for the database:os.chdir(root_dir)db_path=os.path.join("demo","my_project","databse_name.json")Initialize database:mm.models_init(db_path)Fitting a new linear modelLoad databasemodels=json.load(open(db_path,"r"))Specify linear model. The idea is to have a specific model name and a "group/family" for each model.bammmwill create a folder (model_family) and save data of individual models in there usingpickle.# load data that come with bambidata=bmb.load_data("sleepstudy")model_family="sleepstudy"# this will be used as a folder name to host the modelsmodel_identifier="maximum_model"# dependent variablemod["lmm"]["dep_var"]="Reaction"# Reaction time# fixed effectsmod["lmm"]["fxeff"]=["Days"]# longitudinal data set# random effectsmod["lmm"]["rneff"]=["Days|Subject"]# build equationmod["lmm"]["eq"]=mm.generate_equation(mod["lmm"]["dep_var"],mod["lmm"]["fxeff"],mod["lmm"]["rneff"])Specify estimation parameters.# fitting informationmod["est"]["nchains"]=2mod["est"]["nsamples"]=4000mod["est"]["ncores"]=2# number of cores to be useds in fittingSpecify paths and create relevant strings.mod=mm.prepare_fit(mod,model_family,model_identifier,models_path)# save model (it's a good idea to load/save the DB often, especially if one runs multiple models at the same time)models[mod["name"]]=modmm.save_model_info(models,db_path)Estimate model. This also automatically saves the data to the location specified inmodels_pathmod,results,m=mm.estimate_lmm(mod,data,override=0)mm.update_model_entry(models,mod,db_path)Load previously fitted modelIt is rather simple# load databasemodels=json.load(open(db_path,"r"))model_name="sleepstudy_maximum_model_2_4000"# model estimated abovemod=models[model_name]# load modelmod,results,m=mm.estimate_lmm(mod,[],override=0)This might not be thebestway to achieve model saving/loading, but it seems to work well (at least for the poor practitioner of statistics that is me).
Package: bamread
bamreadRead bam files quickly into dataframes in PythonDevelopmentDevelopmentSeeHow to Publish an Open-Source Python Package to PyPIInstallpipinstall-e.# -e flag means editing affects the installed packageCreate sdist and wheel (requiresbuild)python-mbuildCheck whether the package archives look fine:twinecheckdist/*Upload to PyPI test servertwineupload-rtestpypidist/*Chek that the package can be installed from the test serverpython-mpipinstall-ihttps://test.pypi.org/simplebamread
python-c"import bamread; print(bamread.read_bam('Some.bam'))"Upload to pypitwineupload-rtestpypidist/*
Package: bamsalvage
bamsalvageINTRODUCTIONbamsalvage is a tools to recover sequence reads as much as possible from possibly corrupted BAM files.
This software share the common purpose with bamrescue by Jérémie Roquet (https://bamrescue.arkanosis.net/).
bamrescue detects corrupted BGZF block using CRC32 checksums and skip corrupted blocks and the method works well if all blocks begin with new reads.When we would like to recover long-read sequences, a read can span more than one BGZF blocks since the maximum block size is less than sequencer outputs.Skipping corrupted blocks does not solve such the troubles and often results in termination of Samtools and failure of sequence recovery.bamsalvage scans next available start positions when any corrupted blocks are detected.
Since the goal of the software is rescuing sequences, bamsalvage do not recover all information included in BAM file but retrieves reads and qual sequences.INSTALLpip install bamsalvageUSAGEbamsalvage -i [FILE] -o {DIRECTORY] --mode [fa,fa.gz,fastq,fastq.gz] [--verbose]Options:
  -i, --input <FILE>     Input BAM file
  -o, --output <FILE>    Output filename
  -l, --limit <integer>  Limiting counts [default: 0]
  --mode                 Output format (fa:fasta, fa.gz:gzipped fasta, fastq:fastq, fastq.gz(default):gzipped fastq)
  -v, --verbose          verbosity
  -h, --help             Print help
Package: bam-shot
# BAM shot该包用于对BAM文件画图，依赖samtools, python3.X, pyssam版本： 主要参数:bam: BAM文件ref: 参考基因组FASTA，需要提前使用samtools faidx构建索引chrom: 染色体start: 起始位置end：终止位置extend：两端拓展长度……
Package: bamsnap
BamSnapBamSnap: a lightweight command-based visualization tool for sequencing reads in BAM filesFor more details, see BamSnapDocumentation.InstallationPrerequisitespython 3.4+Pillow (Python Imaging Library)pysampyfaidxpytabixInstall with pippipinstallbamsnappypi site for bamsnapInstall with githubgit clone https://github.com/parklab/bamsnap
cd bamsnap
python setup.py installUsageSimple usage$bamsnap-bamtest.bam-pos1:7364529-outtest.pngFor more details, see BamSnapDocumentation.Usage with docker$dockerpulldanielmsk/bamsnap
$dockerrun--rm-it-v/local_directory_path:/directory_path_in_imagedanielmsk/bamsnapbamsnap\-bam/directory_path_in_image/test.bam\-pos1:7364529\-out/directory_path_in_image/test.pngExample Use Case1000 Genome Data: 1000 genomic loci in 2504 individualsBamSnap Plot Gallery
Package: bamsnap-cgap
BamSnapBamSnap: a lightweight command-based visualization tool for sequencing reads in BAM filesFor more details, see BamSnapDocumentation.InstallationPrerequisitespython 3.4+Pillow (Python Imaging Library)pysampyfaidxpytabixInstall with pippipinstallbamsnappypi site for bamsnapInstall with githubgit clone https://github.com/parklab/bamsnap
cd bamsnap
python setup.py installUsageSimple usage$bamsnap-bamtest.bam-pos1:7364529-outtest.pngFor more details, see BamSnapDocumentation.Usage with docker$dockerpulldanielmsk/bamsnap
$dockerrun--rm-it-v/local_directory_path:/directory_path_in_imagedanielmsk/bamsnapbamsnap\-bam/directory_path_in_image/test.bam\-pos1:7364529\-out/directory_path_in_image/test.pngExample Use Case1000 Genome Data: 1000 genomic loci in 2504 individualsBamSnap Plot Gallery
Package: bana
Bana is a set of extensions forAutodesk Maya’s Python API.The Maya’s Python API is often a good choice over the commands layer whenever
performances and robustness are valued. But because of its overall poor design,
it is not uncommon that somefundamentalfunctionalities arelackingout
of the box and/or require too muchboilerplateto get rolling.Other gotchas to be expected include methods that became toodauntingto
use after porting in theworstpossible way the API from C++ to Python,undocumentedbehaviours of certain features where error trialing is
everything that is left, and methodsthrowingan exception when returningNonewould have been more appropriate.Bana aims at reducing these shortcomings to provide a morefriendly,predictable, andefficientdeveloping environment.Using the monkey patching packagegorilla, new methods prefixed withbnare inserted within some classes from themaya.OpenMaya*modules, thus
extending their functionalities while making these new methods feel as if they
were built-in into Maya.Since performances are a primary reason for using the API, a set of benchmarks
built with the help of the packagerevlhelps to ensure that these
extensions remain as fast as possible.NotesBana extends on Maya’s Python API 1.0 rather than 2.0 because the latter
version seems to be still incomplete. That being said, it is encouraged to use
the API 2.0 whenever possible since it provides a much more Pythonic interface
with increased performances.Bana doesnotaim at making the API more Pythonic. This could in some cases
impact the performances, which goes against Bana’s goal of keeping things fast.Featureseasy retrieval of nodes from the scene.robust and predictable specification for pattern matching with wildcards.abstract away the usage of themaya.OpenMaya.MScriptUtilclass.performances as a top priority.Usage>>>importbana>>>bana.initialize()>>>frommayaimportOpenMaya>>># Retrieve a transform node named 'root'.>>>root=OpenMaya.MFnTransform.bnGet(pattern='*|root')>>># Recursively iterate over all the DAG nodes child of 'root'.>>>fornodeinroot.bnFindChildren():...print(node)>>># Find all the mesh nodes in the scene containing the word 'Shape' but...# not belonging to any namespace.>>>fornodeinOpenMaya.MFnMesh.bnFind(pattern='*|*Shape*'):...print(node)See theTutorialsection from the documentation for more detailed examples
and explanations on how to use Bana.DocumentationRead the documentation online atbana.readthedocs.ioor check its source in
thedocdirectory.AuthorChristopher Crouzet
<christophercrouzet.com>ThanksJustin Israel for discovering that multiple instances pointing to a same
Maya object return different hash values.
Package: banal
banalCommons of Python micro-functions. This basically an out-sourced, shared
utils module with a focus on functions that buffer type uncertainties in
Python (e.g. "is this a list?").Rules:Functions are properly typed, library passesmypy.Cannot depend on anything but six and the standard libraryFunctionsis_listish: check if something is list-ishis_mapping: check if an object is dict-ishensure_list: make sure an argument is a list, or make it into a single-element listclean_dict: remove null values from a dict, recursivelydecode_path: decode a path name to be unicodehash_data: generate a SHA1 from a dict of reasonable objects
Package: banana
Brain imAgiNg Analysis iN Arcana (Banana): a collection of brain imaging analysis
workflows implemented in theArcanaframework, which can be used to analyse
analysis datasets stored in XNAT, BIDS or plain-directory repositories.InstallationBanana and its dependencies can be installed from PyPI with:$ pip3 install bananaPipelinesDepending on which pipelines you need to run, you may need to install some or
all of the following tools. Note that MRtrix3 and Dcm2niix are used for implicit
format conversions so are typically required.MRtrix3 (https://github.com/MRtrix3/mrtrix3)Dcm2niix (https://github.com/rordenlab/dcm2niix)FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/)Matlab (https://au.mathworks.com/products/matlab.html)SPM (http://www.fil.ion.ucl.ac.uk/spm/software/spm12/)ANTs (https://sourceforge.net/projects/advants/)Freesurfer (https://surfer.nmr.mgh.harvard.edu)AFNI (https://afni.nimh.nih.gov)
Package: banana-cli
banana-cliThe goal of the Banana CLI is to bring an npm-like experience to ML development loops.This version includes:banana initto create a project with boilerplatebanana installto install packages from the requirements.txtbanana --versionto show the current versionbanana deployto easily deploy the local folder to Banana.dev without using GitHubHere's a demo videoInstalling the CLI locallypython3 -m venv .venv
source .venv/bin/activate
pip3 install -e ./
banana --versionThis is a v0 release using SemVer; it is not stable and the interface can break at any time.To use itCreate a new project directory withbananainitmy-appcdmy-appStart the dev serverpython3app.pyCall your API (from a separate terminal)curl-XPOST-H"Content-Type: application/json"-d'{"prompt": "Hello I am a [MASK] model."}'http://localhost:8000/The interactive dev server works like a react, next, or nodemon server: it selectively hot reloads components when you save changes to different parts of yourapp.pyfile.The init() function is ran on startup and for every change to init().The handler() function is ran on every change to handler(), without needing to wait for a long init()Play with it:Try changing the handler, see what happens!Try changing the init, see what happens!Future Development:Lock in a stable interfaceAdd the following commandsbanana stage-> run a temporary deployment to Banana's cluster for on-GPU testingbanana test-> unit test against local test cases
Package: banana-dev
Banana Python SDKPlease see our usage docs in the officialBanana DocumentationDeveloping on the SDKSet up the environment and install the package in editable modepython-mvenv.venvsource.venv/bin/activate
pipinstall-e./Set up a test directory to play around with the changesmkdirtestscdtests
touchtest.pyCreate some scriptfrombanana_devimportAPIapi=API("11111111-1111-1111-1111-111111111111")projects,status=api.list_projects()print('list',projects,status)project,status=api.get_project(projects["results"][0]["id"])print('get',project,status)updated_project,status=api.update_project(projects["results"][0]["id"],{"maxReplicas":2})print('update',updated_project,status)Run itpythontest.py
Package: banana-dev-staging
Banana Python SDKGetting StartedInstall via pippip3installbanana-devIf integration testing against a local Potassium server:exportBANANA_SERVER=localto callhttp://localhost:8000/directly. Be sure to unset in prod!If deploying to prod:Sign in / log in hereto get your API and Model KeysRun:importbanana_devasbanana# Your credentials. Can be empty strings if testing against a local server.api_key="demo"# YOUR_API_KEYmodel_key="carrot"# YOUR_MODEL_KEYmodel_inputs={# a json specific to your model. For example:"imageURL":"https://demo-images-banana.s3.us-west-1.amazonaws.com/image2.jpg"}out=banana.run(api_key,model_key,model_inputs)print(out)Return type:{"id":"12345678-1234-1234-1234-123456789012","message":"success","created":1649712752,"apiVersion":"26 Nov 2021","modelOutputs":[{# a json specific to your model. In this example, the caption of the image"caption":"a baseball player throwing a ball"}]}Parse the server output:model_out=out["modelOutputs"][0]
Package: banana-i18n
A localization library for Python based on thebananamessage file format.
This library was originally developed inside ofPywikibotand then forked
into a separate library for easier reuse.Message specificationFor the most part we use the upstream banana file format, with a few Python
tweaks.Parameters to messages are specified through printf-style formatting:"bot-change-page": "Bot: Changing %(num)s {{PLURAL:%(num)d|page|pages}}.",All parameters are named. Gender, grammar, and bidi support has not yet been
implemented.UsageAssuming the directory with your JSON files is namedi18n:from banana_i18n import BananaI18n

banana = BananaI18n('i18n')
text = banana.translate('de', 'example')Parameters must be passed as a dictionary:text = banana.translate('de', 'bot-change-page', {'num': 2})If the parameter is going to be used in{{PLURAL:}}, it must be theinttype.A list of all localized languages can be accesssed throughbanana.known_languages().Licensebanana-i18n is available under the terms of the MIT license.(C) 2004-2019 Pywikibot team(C) 2011-2017 xqt(C) 2020 Kunal Mehta <legoktm@member.fsf.org>
Package: bananaplots
A simple tool for making banana plots from several multi-dimensional point datasets.The term banana here refers to the usual shape of the contours of two feature projection of the datasets. See the gallery to see the graphical motivation.We’d like a tool to drive matplotlib. Declarative.The distribution of points are internally modelled with a gaussian mixture model.Gallery (Plots that shall be able to make)https://docs.google.com/document/d/13h6d35Ily_QobpCk3xNivwm4WW_b36pTXpNITnFWPOo/edit?usp=sharingHere is an example code:https://github.com/bccp/bananaplots/blob/master/bananaplots/tests/test_bananaplots.py#L15which produces the following two figures.NotesThis is an ongoing work.Martin White suggested the project in August of 2016.Yu Feng discussed the project as an Hack at the AstroHackWeek 2016 with
Brigitta Sipocz, Dan Foreman-Mackey, and Jake VanderPlas.Three major outcomes:Histograms capture tails much better than mixture of gaussians. We currenlty do not
support histograms.if we can model the MCMC as a mixture of gaussian, then there
probably is a easier way to model the likelihood than running MCMC.In addition, we shall explore a declaritive way of describing a plot that
supports more complicated modelling. Vega-Lite does not appear to support this.The scaffold of the project is roughly based onhttps://github.com/kbarbary/greeterbut we use runtests.py from numpy c.f.https://github.com/kbarbary/greeter/issues/8
Package: banana-server
serverAn HTTP server designed for AIQuickstartInstall the Banana server packagepip3installbanana-serverCreate a python file calledmain.pywith this:frombanana_serverimportBananaapp=Banana("server")@app.initdefinit():model="my pytorch model"app.optimize(model)returnapp.set_cache({"model":model,"hello":"world"})@app.handlerdefhandler(cache,json_in)->dict:print("cache:",cache)print("json_in:",json_in)return{"json":"out"}app.serve()Run it withpython3main.pyTest the running server withcurl-XPOST-H"Content-Type: application/json"-d'{"name":"test"}'http://localhost:8000Documentationbanana_server.Bananafrombanana_serverimportBananaapp=Banana("server")This instantiates your HTTP app, similar to popular frameworks likeFlaskThis HTTP server is production-ready out of the box.@app.init@app.initdefinit():model="my pytorch model"app.optimize(model)returnapp.set_cache({"model":model,"hello":"world"})The@app.initdecorated function runs once on server startup, and is used to load any reuseable, heavy objects such as:Your AI model, loaded to GPUTokenizersPrecalculated embeddingsOnce initialized, you must save those variables to the cache withapp.set_cache({})so they can be referenced later.There may only be one@app.initfunction.@app.handler@app.handlerdefhandler(cache,json_in)->dict:print("cache:",cache)print("json_in:",json_in)return{"json":"out"}The@app.handlerdecorated function runs for every http call, and is used to run inference or training workloads against your model(s).ArgTypeDescriptioncachedictThe app's cache, set with set_cache()json_indictThe json body of the input call. If using the Banana client SDK, this is the same as model_inputsReturn ValTypeDescriptionjson_outdictThe json body to return to the client. If using the Banana client SDK, this is the same as model_outputsThere may only be one@app.handlerfunction.app.set_cache()app.set_cache({})app.set_cachesaves the input dictionary to the app's cache, for reuse in future calls. It may be used in both the@app.initand@app.handlerfunctions.app.set_cacheoverwrites any preexisting cache.app.get_cache()cache=app.get_cache()app.get_cachefetches the dictionary to the app's cache. This value is automatically provided for you as thecacheargument in the@app.handlerfunction.app.optimize(model)model# some pytorch modelapp.optimize(model)app.optimizeis a feature specific to users hosting onBanana's serverless GPU infrastructure. It is run during buildtime rather than runtime, and is used to locate the model(s) to be targeted for Banana's Fastboot optimization.Multiple models may be optimized. Only Pytorch models are currently supported.
Package: bananopy
🍌🥧 is a python wrapper for Banano node communication.
It takes care of RPC responses (type conversions) and exposes a pythonic API for making RPC calls.Full list of RPC calls is coming fromdocs.SetuppipinstallbananopyBananopy checks ifBANANO_HTTP_PROVIDER_URIenvironment variable is set.To set it run:exportBANANO_HTTP_PROVIDER_URI=<ip_address>Otherwise, bananopy will fallback and use public node (https://api-beta.banano.cc) for API calls.Note:Public node is running Banano Node v18, meaning some requests might fail.DevelopmentRepository usespoetryto keep track of dependances. Once you have poetry installed make sure
you are on Python 3.7+ and run these commands:gitclonehttps://github.com/milkyklim/bananopy.gitpoetryinstallTo run the tests:poetryrunpytest-vNote:Only public requests are actually tested. Dangerous RPC calls controlled byenable_controlare checked for error response only.Conversionfloattype is not supported in conversion, e.g.ban_to_banoshicause it might lead to unexpected precision loss.
Usestr,intorDecimaltypes instead.Example>>>importbananopy.bananoasbanUsinghttps://api-beta.banano.ccasAPIprovideronport443>>>account="ban_1bananobh5rat99qfgt1ptpieie5swmoth87thi74qgbfrij7dcgjiij94xr">>>ban.account_balance(account){'balance':1626688000000000000017763568393401,'pending':0}SupportBenis toban_1dsarukqn5y8oqho43praocn97wjs17t8eppzgfb78nzzxmjapkidxrcgsqc
Package: bancardconnectorpython
Getting StartedThis library allows developers to integrate their Python backend
applications to the Bancard VPOS API.This library works with the following Python versions: 2.6, 2.7, 3.3,
3.4, 3.5, 3.6PrerequisitesSee the requirements.txt file to see which Python libraries will be
required.Usage in Staging or ProductionYou can either include this library from:https://github.com/vcajes/bancard-connector-pythonOr install the library from thePYPI
repository:pip3 install bancardconnectorpythonUsage in developmentDownlaod and installPython (2.6 <= version <=
3.6).Runpip install bancardpythonconnector.Import and use library in your source code:import bancardconnectorpython.This will autoconfigure the connector from the following OS environment variables:BANCARD_ENVIRONMENT=sandbox|productionBANCARD_PUBLIC_KEY=your_public_keyBANCARD_PRIVATE_KEY=your_private_keybancard_api = bancardconnectorpython.connector()or you could just create your own BancardAPIbancard_api = bancardconnectorpython.BancardAPI(environment=bancardconnectorpython.ENVIRONMENT_SANDBOX,
public_key=your_public_key, private_key=your_private_key)Running testsDownload and installPython (2.6 <= version <= 3.6)Install the library from PYPI:pip install bancardconnectorpythonSet the following two OS environment variablesBANCARD_PUBLIC_KEYandBANCARD_PRIVATE_KEYwith the values provided by Bancard.Run any of the tests, i.e.:python /path/to/tests/test_bancard_single_buy.pyVersioningFor the versions available, see thetags on this
repositoryAuthorsVictor Cajes- [@vcajes](https://github.com/vcajes)LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: bancodeusuarios
Banco de Usuariosbancodeusuariosé um simples pacote para gerenciar o cadastro, armazenamento e consulta de usuários em um sistema.DependênciasPython 3.6ou posteriorComeçando o usoVocê vai precisar instalar o pacotebancodeusuarios, para isso basta executar:pip install bancodeusuariosFunçãointeragir()- Coleta o CPF, Nome e o Endereço do usuario.armazenar()- Armazena as informações coletadas em um arquivo .txt.consultar()- Consulta o arquivo de texto e exibe as informações referentes ao CPF informado.DemoO pacote ainda conta com um arquivomain.pyque demonstra o funcionamento do mesmo.
Package: bancointer
Banco InterClient to consume Banco Inter APIsDocumentation:https://bancointer.readthedocs.io.InstallationpipinstallbancointerHow to UseHigh-level APIfrominterimportInterinter=Inter(client_id="YOUR_CLIENT_ID",client_secret="YOUR_CLIENT_SECRET"cert_path='/path/to/certificado.crt',key_path='/path/to/chave.key',)# get September/2022 statementsinter.get_statements(date(2022,9,1),date(2022,9,30))Testingfrominter.testingimportInterFakedefmy_function(inter):returninter.get_balance()deftest_my_function():inter=InterFake()result=my_function(inter)assertresult==inter.balanceLow-level APIfromdatetimeimportdatefrominterimportClientasInterinter=Inter("YOUR_CLIENT_ID","YOUR_CLIENT_SECRET"'/path/to/certificado.crt','/path/to/chave.key',)# get September/2022 statementsinter.get_statements(date(2022,9,1),date(2022,9,30))Testingfrominter.testingimportClientFakedefmy_function(client):returnclient.get_balance()deftest_my_function():client=ClientFake()result=my_function(client)assertresult==client.balanceContributingContributions are welcome, feel free to open an Issue or Pull Request.Pull requests must be for thedevelopbranch.git clone https://github.com/lucasrcezimbra/bancointer
cd bancointer
git checkout develop
python -m venv .venv
source .venv/bin/activate
pip install .[test]
pre-commit install
pytest