Saravanan666/pypi-org huggingface dataset:
Package: migreat
migreatA flexible SQL migration runner.Right now, supports only PostgreSQL viapsycopg2, as it's still an experiment. Support for any database with a DBAPI implementation is planned.Installmigreatsupports Python 3.7, 3.8, and 3.9. Since it currently only supports PostgreSQL viapsycopg2, it will also be installed.pip install migreatMental Modelmigreatruns SQL migrations with a DB cursor provided by your code via a function, and stores migration metadata in a table with the datetime it was run, the ID of the user who ran it, the name of the migration, and a hash of its contents at the time it was run. The hash of a migration will be checked against if it is ever rolled back, to make sure we are rolling back the same migration that was once run.UsageMigrations are simple SQL files placed inside a directory and following a name pattern. The name pattern isYEAR-MONTH-DAY-SEQNUM-arbitrary-name.sql.YEAR-MONTH-DAYis the day's date following ISO 8601. TheSEQNUMis a 2-digit sequential number for migrations released in the same day. Some valid names:2020-01-10-03-create-users-table.sql
2020-03-18-01-remove-foreign-keys-from-audit-tables.sqlmigreatwill run the migrations in sequence of date and sequence number.Create the migrations table:$ migreat create-migrations-table \
    --cursor-factory yourapp.db.atomicRun migrations:$ migreat run \
    --migrations-dir migrations \
    --user-id 42 \
    --last-migration 2020-01-01-01 \
    --cursor-factory yourapp.db.atomic \
    --rollbackThis will:Look for the migrations in directorymigrationsrelative to the current working directory;If this is not supplied, the default value will bemigrations;Run the migrations as user with ID 42;Run migrations rolling them back, only back up to migration2020-01-01-01;Run the functionyourapp.db.atomicwith no arguments expecting it to return a DBAPI cursor (see tests for an example).migreatallows you to constrain the user ID to real user IDs you might have in some table in your database. To enable it:$ migreat create-user-id-foreign-key users id \
    --cursor-factory yourapp.db.atomicThis will constrain user IDs to values in the columnidof tableusers.Finally, you can drop the user ID foreign key constraint:$ migreat drop-user-id-foreign-key \
    --cursor-factory yourapp.db.atomicAnd drop the migrations table:$ migreat drop-migrations-table \
    --cursor-factory yourapp.db.atomicAll above commands also accept:--cursor-factory-args=value1,value2
--cursor-factory-kwargs=key1,value1,key2,value2Values are valid CSV strings and can contain nested commas inside proper delimiters.DevelopmentClone the source code from GitHub, have a Docker Engine reachable, have all supported Python interpreters in yourPATH(we recommend that you usepyenvto manage different Python interpreters and environments) and create a new virtual environment withpoetry install.Run the tests with:./run test-db
# Wait for the database to be ready
./run all-testsTo run a specific test:./run test-db
# Wait for the database to be ready
./run test <test-address>To make sure your code abides to our quality standards, run:./run quality
Package: migri
Migri is a simple async Python migration tool. You can use the CLI (run yourself or from a shell script) or import the
exposed functions and run programatically. Currently supports PostgreSQL
(asyncpg), SQLite (aiosqlite),
and MySQL (aiomysql).migriis currently in alpha and although unlikely, the implementation may changeMotivationUsing async database libraries is useful when a service/application is already using an
async library. It's extra overhead to install a synchronous library just to run migrations.
Practically speaking, though, there isn't much benefit to running migrations asynchronously
since migrations must be applied synchronously. Besides, the number of migrations for a
service is generally small.Getting startedInstallmigripip install migri[mysql]
pip install migri[postgresql]
pip install migri[sqlite]Create migrationsCreate amigrationsdirectory and add your migrations. Migrations are applied in
lexicographical order (e.g.0001_initial.sqlthen0002_add_user_data.pyand so on).Currently.sqland.pyfiles are supported. If you write a Python migration file,
ensure that it contains an async functionmigrate. An instance of asyncpg'sConnectionclass will be passed into the function.asyncdefmigrate(conn)->bool:awaitconn.execute("INSERT INTO categories (name) VALUES ($1)","Animals")returnTrueMigrateRunmigri migrate. Provide database credentials via arguments or environment variables:--db-nameorDB_NAME(required)--db-userorDB_USER--db-passorDB_PASS--db-hostorDB_HOST--db-portorDB_PORTOther options:-d, --dialectorDB_DIALECT(mysql,postgresql,sqlite,
note that currently onlypostgresqlis supported. If not set,migriwill attempt to infer the dialect (and library to use)
using the database port.)-l, --log-levelorLOG_LEVEL(defaulterror)When you runmigrate,migriwill create a table calledapplied_migration(if it
doesn't exist). This is howmigritracks which migrations have already been applied.Dry run modeIf you want to test your migrations without applying them, you can use the dry run
flag:--dry-run.Unfortunately, dry run mode does not work with SQLite at this moment. If you want to try to get it to work, see
theissue.Dry run mode also doesn't work w/ MySQL because DDL statements implicitly commit.Migrate programmaticallyMigri can be called with a shell script (e.g. when a container is starting) or you can
apply migrations from your application:frommigriimportapply_migrations,PostgreSQLConnectionasyncdefmigrate():conn=PostgreSQLConnection("sampledb",db_user="user",db_pass="passpass",db_host="localhost",db_port=5432)asyncwithconn:awaitapply_migrations("migrations",conn)TestingSet up local Python versions (e.g.pyenv local 3.7.7 3.8.3)Rundocker-compose upto start Postgresql.Install nox withpip install nox.Runnox.DocsDocstrings are formatted in theSphinxformat.TodosDon't record empty migrations - warn userAdd dry run mode for testing migrationsOutput migration resultsTest modules not foundTest/handle incorrect migrate function signature (in migration Python files)Add colorful output 🍭 for enhanced readabilityMake error output more readable
Package: migro
migroData Warehouse migrations for dbt.SetupInstallmigroin adbtproject.pip install migroCreate a migration. For example:mkdir migrations
 migro make create_bobby_tables_userOpen the sql file in themigrationsfolder and add this statement.create user bobby_tables with password '{{ password }}';Pretend to run the migration. Notice the password generated by the{{ password }}jinja template.migro up --pretend --limit=1Now run the migration.migro upQuery the new migrations table to see the migration history.select * from public.migrations order by id;Data Warehouse SupportRedshiftSnowflake
Package: mig-utils
A Minimum Intrusion Grid(MiG) utilities python library:
It includes the mig.io module that provides access to MiG Sharelinks through
python by wrapping around (https://github.com/althonos/fs.sshfs) for sshfs
connections and (https://github.com/ParallelSSH/ssh2-python.git) for sftp
which is the default and recommended connectionInstallationInstallation from pypipipinstallmig-utilsInstallation from a local git repositorycdmig-utilspipinstall.IO ExampleERDA (https://erda.dk) sharelink access with python3 example.
A likewise sharelink class (IdmcShare) exists for IDMC (https://idmc.dk)# First import the class that gives you access to the share in question*frommig.ioimportERDAShare,IDMCShare# ERDA Sharelink exampleprint("ERDA")# Open connection to a sharelinkerda_share=ERDAShare('SHARELINKID')# List files/dirs in shareprint(erda_share.list())witherda_share.open('tmp','w')astmp:tmp.write("sdfsfsf")# Get a _io.SFTPFileHandle object with automatic closewitherda_share.open('tmp','r')astmp:print(tmp.read())# Get a default _io.SFTPFileHandle object with manual lifetimefile=erda_share.open('tmp','r')print(file.read())file.close()# remove fileerda_share.remove('tmp')print("\n")# IDMC Sharelink exampleprint("IDMC")# Open connection to a sharelinkidmc_share=IDMCShare('SHARELINKID')# List files/dirs in shareprint(idmc_share.list())# write binary stringwithidmc_share.open('b_tmp','wb')asb_tmp:b_tmp.write(b'sadasdasd')# Get a _io.SFTPFileHandle object with automatic closewithidmc_share.open('b_tmp','rb')astmp:print(tmp.read())# Get a default _io.TextIOWrapper object with manual lifetimefile=idmc_share.open('b_tmp','rb')print(file.read())file.close()
Package: miguxespy
Miguxes_pymiguxes_pyé um modulo que traduz português para as seguintes
variações de miguxês:arcaico;moderno;NEO-miguxês.A principal função do módulo é a funçãomiguxar(texto, dialeto), que
recebe um texto para ser transformado e um dialeto.InstalaçãoPode ser instalada através do pip, utilizando o comando:pip install miguxes_pyExemplo de uso:frommiguxes_py.miguxesimportmiguxarfrommiguxes_py.dialetosimportDialetoMiguxesif__name__=="__main__":print(miguxar("Você acha engraçado tirar screenshots dos NFTs das pessoas, hein?""",DialetoMiguxes.MIGUXES_MODERNO))A saída seria:vc axa engrassadu tirah screenxots dus nfts das pessoas... hein??!?!Inspirado no projeto de Aurelio Jargas, que pode ser encontrado em:https://aurelio.net/coisinha/miguxeitor
Package: migverify
INTRODUCTIONIn our experience, Migrate-N does not work well with monomorphic loci.migverifywill go through yourinfile, and output aninfile_clean.By default,migverifywill remove all loci that have fewer than two
haplotypes, and will remove loci with samples with more than 10% missing
data. These values can be changed.INSTALLATIONmigverifyis written in Python3 (requires version >=3.6). It can be
installed withpip:`pip3 install migverify`To get the latest version:`pip3 install git+https://www.github.com/andersgs/migverify.git`USAGEInstallation will make available a script calledrun_migverify,
which should be in yourPATH.You can checkout the help with:`run_migverify --help`Running with default settings`run_migverify infile`Filter out loci with fewer than 3 haplotypes`run_migverify -m 3 infile`Filter out loci with samples with more than 20% missing data`run_migverify -p 0.2 infile`QUESTIONS or ISSUESGitHub Issues
Package: mihifepe
mihifepeOverviewmihifepe, orModelInterpretability viaHierarchicalFeaturePerturbation, is a library implementing a model-agnostic method that, given a learned model and a hierarchy over features, (i) tests feature groups, in addition to base features, and tries to determine the level of resolution at which important features can be determined, (ii) uses hypothesis testing to rigorously assess the effect of each feature on the model’s loss, (iii) employs a hierarchical approach to control the false discovery rate when testing feature groups and individual base features for importance, and (iv) uses hypothesis testing to identify important interactions among features and feature groups.mihifepeis based on the following paper:Lee, Kyubin, Akshay Sood, and Mark Craven. 2019. “Understanding Learned Models by Identifying Important Features at the Right Resolution.” In Proceedings of the AAAI Conference on Artificial Intelligence, 33:4155–63.https://doi.org/10.1609/aaai.v33i01.33014155.Documentationhttps://mihifepe.readthedocs.ioInstallationRecommended installation method is viavirtual environmentsandpip.
In addition, you also needgraphvizinstalled on your system.When making the virtual environment, specify python3 as the python executable (python3 version must be 3.5+):mkvirtualenv -p python3 mihifepe_envTo install the latest stable release:pip install mihifepeOr to install the latest development version from GitHub:pip install git+https://github.com/Craven-Biostat-Lab/mihifepe.git@master#egg=mihifepeOn Ubuntu, graphviz may be installed by:sudo apt-get install graphvizDevelopmenthttps://mihifepe.readthedocs.io/en/latest/contributing.htmlUsagehttps://mihifepe.readthedocs.io/en/latest/usage.htmlLicensemihifepeis free, open source software, released under the MIT license. SeeLICENSEfor details.ContactAkshay SoodChangelog0.2.1 (2019-12-29)Package sub-modulesFix Travis auto-deployment to PyPIUpgrade numpy dependency0.2.0 (2019-12-27)Regression tests - serial and distributed (condor)Sympy to manage simulated modelPairwise interaction analysisCorrected adjusted p-values for non-rejected nodesVarious minor fixes and documentation updates0.1.1 (2018-09-14)First release on PyPI
Package: mihkelBayesian
mihkelBayesianThis is a Bayesian optimizer created to optimize hyperparameters different functions and machine learning.InstallationRun the following command:
pip install mihkelBayesianHow to mihkelBayesianOptimizing hyperparametersIn order to optimize 2 hyperparameters you need to:from mihkelBayesian import optimizemin_val, min_hyperparameters = optimize.run(evaluateFunction, functionConstants, n_iterations,bounds)evaluateFunction - a string of the same name as the function you wish to evaluate in functions.py.
functionConstans - a list of constants you wish to apply to the evaluateFunction
n_iterations - how many measurements of the function the optimizer is allower to make
bounds - (1 x 2) shape numpy array that limits the searchspace in the form of [[x1min,x1max],[x2min,x2max]]
min_val - the smallest function value
min_hyperparameters - hyperparameter pair corresponding to that value.(Eg. run("rosenbrock",[1,10],300,np.array([[0,10],[-20,40]])))Choosing the function to evaluateOpen functions.py to see all currently available functions. Each function takes an array XY that is automatically generated by the optimizer and a list of function constants that the function uses. Use one of the pre-existing functions or write your own function that the optimizer will call upon. Custom function can be analytical, machine learning etc.TestingPytest is used to test the code. All tests are located in the 'tests' folder.To run the tests, execute:pytestNotesYou can vary the hyperparameters of the optimizer in order to get better results.More than 500 no_iterations takes long time to compute. Often no more than 300 iterations are needed.One run with 500 iterations takes about 4 minutes if the function evaluation is instantaneous.
Package: mihome
Library to use the Xiaomi Mi Home zigbee hub (receive paquets, events for now).Example of usage as a simple mqtt relay:```pythonimport paho.mqtt.client as mqttMQTT_SERVER = "192.168.0.149"MQTT_PORT = 1883PATH_FMT = "xiaomi/{model}/{sid}/{prop}" # short_id or sid ?def prepare_mqtt():client = mqtt.Client()client.connect(MQTT_SERVER, MQTT_PORT, 60)return clientdef push_data(client, model, sid, cmd, data):for key, value in data.items():path = PATH_FMT.format(model=model,sid=sid,cmd=cmd,prop=key)client.publish(path, payload=value, qos=0)client = prepare_mqtt()cb = lambda m, s, c, d: push_data(client, m, s, c, d)connector = XiaomiConnector(data_callback=cb)while True:connector.check_incoming()```For more information on the protocol and devices, see my notes: https://notes.jmsinfor.com/blog/post/admin/Xiaomi-Hub
Package: miidl
MIIDLMIIDL/ˈmaɪdəl/is a Python package for microbial biomarkers identification powered by interpretable deep learning.Getting Started👋Welcome!🔗This guidewill provide you with a specific example that usingmiidlto detect microbial biomarkers of colorectal cancer and predict clinical outcomes.After that, you will learn how to use this tool properly.Installationpipinstallmiidlorcondainstallmiidlcaptum-cpytorch-cconda-forge-cbiocondaFeaturesOne-stop profilingMultiple strategies for biological dataMore interpretable, not a "black box"Workflow1) Quality ControlThe very first procedure is filtering features according to a threshold of observation (non-missing) rate (0.3 by default).2) Normalizationmiidloffers plenty of normalization methods to transform data and make samples more comparable.3) ImputationBy default, this step is inactivated, asmiidlis designed to solve problems including sparseness. But imputation can be useful in some cases. Commonly used methods are available if needed.4) ReshapeThe pre-processed data also need to be zero-completed to a certain length, so that a CNN model can be applied.5) ModelingA CNN classifier is trained for discrimination.PyTorchis needed.6) InterpretationCaptumis dedicated to model interpretability for PyTorch. This step depends heavily on captum.ContactIf you have further thoughts or queries, please feel free to email atchunribu@mail.sdu.edu.cnor open an issue!LicenceMIIDL is released under theMIT licence.CitationThe manuscript is in preparation.
Package: miind
MIIND: a population level simulator.MIIND is a simulator that allows the creation, simulation and analysis of large-scale neural networks. It does not model individual neurons, but models populations
directly, similarly to a neural mass model, except that we use population density techniques. Population density techniques are based on point model neurons, such as
leaky-integrate-and-fire (LIF), quadratic-integrate-and-fire neurons (QIF), or more complex ones, such as adaptive-exponential-integrate-and-fire (AdExp), Izhikevich,
Fitzhugh-Nagumo (FN). MIIND is able to model populations of 1D neural models (like LIF, QIF), 2D models (AdExp, Izhikevich, FN, others), or 3D models (Hindmarsh-Rose, Tsodyks-Markram Synapse). It does so by using
statistical techniques to answer the question: "If I'd run a NEST or BRIAN simulation (to name some point model-based simulators), where in state space would my neurons be?"
We calculate this distribution in terms of a density function, and from this density function we can infer many properties of the population, including its own firing rate.
By modeling large-scale networks as homogeneous populations that exchange firing rate statistics, rather than spikes, remarkable efficiency can be achieved, whilst retaining
a connection to spiking neurons that is not present in neural mass models.Documentation and Installation InstructionsMIIND is available through pypi and can be installed on most Linux and Windows systems (Mac version in development) with the command:$ python -m pip install miindFor building from source and further documentation:https://miind.readthedocs.io/en/latest/Three dimensional population density methods!They said it could not be done, but we have created an efficient version of the Hindmarsh rose model,
a neural model with three state variables.GallerySingle Population: Fitzhugh-Nagumo (Mesh Method)IzhikevichAdaptive Exponential Integrate and FireReplication of Half Center Central Pattern Generator
Package: miinto-api-wrapper
miinto-api-wrapperMiinto API Wrapper is a simple python wrapper for Miinto API.Miinto is a fashion luxury marketplace.For more information see theMiinto Groupwebsite.-- THIS IS NOT AN OFFICIAL CODEBASE FROM MIINTO --installationpip install miinto-api-wrapperDisclaimerThis deployment is NOT completed - just some basic HTTPs calls are wrapped.Anyway it can be used in production.Requirementspython 3.x required
urlparse requiredKind of rapid instructions:See some examples on example.py
Package: mijnah
mijnahInteract with mijn Albert Heijn V2 APIInstallationpip install mijnahUsageCartAH uses a recaptcha token to authenticate, so it's easier to pass aah_tokenorah_token_presumed(found in a cookie after authenticating).Authentication:importmijnahah=mijnah.Cart(ah_token_presumed="my-ah-token")List cart:ah.list_cart()Add item to cart:ah.add_to_cart(product_id=1234,amount=2)The id can be found in the product url. For example the id inhttps://www.ah.nl/producten/product/wi471282/chatelain-notre-dame-medocis471282.Update cart:ah.update_cart(product_id=1234,amount=0)Empty cart:ah.empty_cart()ProductInitialize:importmijnahp=mijnah.Product(product_id=1234)Object properties:p.idp.namep.categoryp.descriptionp.brandp.priceExampleGetting cart totalsimportmijnahimportjsonah=mijnah.Cart(ah_token_presumed='ah_token')ah.empty_cart()# add some itemsah.add_to_cart(product_id=168153,amount=2)ah.add_to_cart(product_id=224710,amount=1)ah.add_to_cart(product_id=129138,amount=3)ah.add_to_cart(product_id=198412,amount=2)cart=ah.list_cart()# Generate invoiceprint(json.dumps([{'product':item['product'].name,'quantity':item['quantity'],'price':item['product'].price,'total':item['quantity']*item['product'].price}foritemincart],indent=2))# Get total itemsprint('total items:',sum(item['quantity']foritemincart))# Get total itemsprint('total price:',sum(item['quantity']*item['product'].priceforitemincart))[{"product":"AH IJsbergsla voordeel","quantity":2,"price":1.79,"total":3.58},{"product":"AH Babyspinazie","quantity":1,"price":1.59,"total":1.59},{"product":"AH Frambozen","quantity":3,"price":2.39,"total":7.17},{"product":"Valle del sole Popcorn ma\u00efs","quantity":2,"price":1.53,"total":3.06}]totalitems:8totalprice:15.4Changelog1.2.0Added ability to useah_token,ah_token_presumed, or both.Added tests1.1.0Initial version
Package: mikado-graph
Mikado GraphPython tool to draw graphs for Mikado refactoring.Learn what is theMikado methodLearn how toleverage Mikado graphs in your refactoring tasksPython packagehosted on pypiQuickstartStart by saving this description file as asexample.txt_ Extend X with Y
    x Remove flag Z from X
        x Replace D with E
            x Check C
    # Ignore this line
    _ Add field X in Y
        x Do fix A
        _ Add B
        x Check CThen runpipinstallmikado-graph
mikadoexample.txt--viewA new window should display the graph belowExplore the options using--helpmikado--helpAnd learn more about the description file format below.Graph description symbolsParent/child dependency is encoded by indentation.There are three kinds of nodes in the graphComments are prefixed by one of the following symbol://,#Done tasks (drawn in green) are prefixed by one of the following symbols:v,V,x,XPending tasks (drawn in red) are prefixed by any symbol that is not used by the above two choices.
We recommend using_to keep the description file human readableDev & DeployDeploy by runningpythonsetup.pysdistbdist_wheel
twineuploaddist/*Known issuesgraphvizwill always save a temporary file when asked to render the graph.
Package: mikan-card-downloader
MikanMikan automatically downloads cards from various idol or idol-adjacent gacha mobile games.The following games are currently supported:Love Live! School Idol Festival (viaSchool Idol Tomodachi)Love Live! School Idol Festival ALL STARS (viaIdol Story)Love Live! School Idol Festival 2 (viaIdol Story)BanG Dream! Girls Band Party! (viaBandori Party)Revue Starlight -Re LIVE- (viaStarlight Academy)IDOLM@STER Cinderella Girls Starlight Stage (viaCinderella Producers)InstallationTo install Mikan, you need to installpipx(see instructions) and then runpipx install mikan-card-downloader.To update it, runpipx upgrade mikan-card-downloader.Installing throughpipis also possible, but not recommended, and since Python 3.11 requires the--break-system-packagesflag.Building by source(Note: this software requiresPython>=3.10 andPoetry)Clone this GitHub repository (git clone https://github.com/DemonicSavage/mikan.git)Go to themikandirectory (cd mikanon Unix).Runpoetry installto grab the necessary dependencies.ConfigurationThe configuration file currently has the following options:# Path for the downloaded cards[Paths]data_dir=~/Idol_Cards# Other options[Other]# Formerly needed for SIF2 supportcookie=your_sessionid_cookie# Maximum concurrent connections, default is 10max_connections=10You can find this file in$XDG_CONFIG_HOME/mikanon Linux,%APPDATA%\Local\mikan\mikanon Windows, or/Library/Application Support/mikanon macOS.UsageThis is a command line script. It first creates (or updates) a metadata file about the available cards (items.json), and then downloads the image files themselves.By default, runningmikanwithout any arguments will create metadata and then download SIF2 cards.Arguments can be passed tomikanto download cards from other games. Runmikan --helpto see what arguments are available.Note that for now, you need asessionidcookie for an Idol Story account with beta-testing enabled for SIF2 support.This is no longer the case.Running it for the first time will prompt you for the directory cards and stills should be downloaded to.LicenseThis software is released under the GNU GPLv3 license, and its dependencies are released under their respective licenses.LinksPyPIGitHub