package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
alignak_setup
Alignak setup utilities=======================*Utility functions to build checks packages setup.*This package is deprecated and should not be used anymore for the installation of the alignak checks packs and modules !-------------Release notes-------------**Version 0.2.2:*** allow installing from Python 2.6 (no more exit on Python > 2.6)* parse all files in the `ALIGNAKETC` sub-directory for Alignak variables**Version 0.1.2:*** first published versionInstallation------------To install the package from PyPI:::pip install alignak-setupPackager features-----------------This module implements interesting features for the Alignak packager:File parsing~~~~~~~~~~~~If your Alignak checks package or module needs to adapt configuration files to the real system Alignak setup, you can define a sub-directory named `ALIGNAKETC`. The content of this sub-directory will be copied (during installation process...) in the real Alignak *etc* directory of the target system.In addition, all the files in this sub-directory will be included in the `to_be_parsed_files` list. The default setup process parses this list of file to replace variables with their real value found in the current Alignak installation. See the result of the `get_alignak_cfg` function for this list of variablesThe most usual need for this is to get the real Alignak configuration or log directory. If it exists, in your package, a file named *ALIGNAKETC/arbiter/modules/mod-example.cfg* and if this file contains::## Module: example## Loaded by: Brokerdefine module {module_alias examplepython_name alignak_module_example# Log filenamelog_file ALIGNAKLOG/my_logs.log# Extra configurationcfg_file ALIGNAKETC/arbiter/modules/my_conf.cfg}this file will be copied to */usr/local/etc/alignak/arbiter/modules/mod-example.cfg* and its content will be parsed to replace Alignak variables. The result will be::## Module: example## Loaded by: Brokerdefine module {module_alias examplepython_name alignak_module_example# Log filenamelog_file /usr/local/var/log/alignak/my_logs.log# Extra configurationcfg_file /usr/local/etc/alignak/arbiter/modules/my_conf.cfg}File replacement and backup~~~~~~~~~~~~~~~~~~~~~~~~~~~As a default behaviour, the files to be installed that are already existing will not be replaced.To change the default behaviour, you can set an environment variable: `ALIGNAK_SETUP_REPLACE`. If this variable exists, the former existing files will be replaced with the new package files.If you set an environment variable: `ALIGNAK_SETUP_BACKUP`. The replaced files will be backed-up with an installation date timestamp. This to avoid deleting former configuration files...Documentation-------------This package contains utility functions to be used in the *setup.py* installation scripts of Alignak checks packages.**Note** that the default *setup.py* do not need to be changed because it implements a default behavior suitable for almost any Alignak checks package or module installer.get_alignak_cfg~~~~~~~~~~~~~~~This function gets the locally installed Alignak directories to be used. It returns a dictionary containing the main Alignak installation information.::alignak_cfg = {'ALIGNAKETC': '/usr/local/etc/alignak','ALIGNAKVAR': '/usr/local/var/lib/alignak','ALIGNAKBIN': '/usr/local/bin','ALIGNAKRUN': '/usr/local/var/run/alignak','ALIGNAKLOG': '/usr/local/var/log/alignak','ALIGNAKLIB': '/usr/local/var/libexec/alignak','ALIGNAKUSER': 'alignak','ALIGNAKGROUP': 'alignak'}get_files~~~~~~~~~This function returns the list of files concerned by the installation process. The result is a tuple containing:- `data_files`, a list of the data files detected in the current package. Each item in this list is formatted as Python setup.py expects for its data_files variable (eg. local package file, target file)- `to_be_parsed_files`, an array of files that will be parsed for Alignak variables. Each item in this list is a tuple with target directory and file name.- `to_be_installed_files`, an array of files that will be installed. Each item in this list is a tuple with target directory and file name.When calling this function for the setup of an Alignak module, you must specify the *module* parameter when calling the function.If the module has a sub-directory named `ALIGNAKETC`, the content of this sub-directory will be copied (during installation process...) in the real Alignak *etc* directory of the target system. All the files in this sub-directory will also be included in the `to_be_parsed_files` list.get_to_be_installed_files~~~~~~~~~~~~~~~~~~~~~~~~~This function returns the list of the files that will be really copied during the installation process.As a default behaviour, the files to be installed that are already existing will not be replaced. The default behaviour can be changed thanks to the environment variables: `ALIGNAK_SETUP_REPLACE` and `ALIGNAK_SETUP_BACKUP`.parse_files~~~~~~~~~~~This function iterates the provided list of files and replace the foud Alignak variables by their real value. This is very useful to update a default script or macro with the real Alignak installation existing on the target system.Bugs, issues and contributing-----------------------------Contributions to this project are welcome and encouraged ... issues in the `project repository <https://github.com/alignak-monitoring-contrib/alignak-setup/issues>`_ are the common way to raise an information.
alignak-webui
Web User Interface for Alignak monitoring framework …ScreenshotsDocumentationYou can find online documentation onRead The Docsand in the/docsdirectory.InstallationThe Alignak WebUI is easily installed and started thanks to the Python Package:# Installing... pip install alignak-webui # Running... alignak-webui-uwsgi # Using! http://127.0.0.1:5001Note:Please note that you need to have a running Alignak framework reporting the live state to the Alignak backend.Bugs, issues and contributingContributions to this project are welcome and encouraged, but please have a look to thecontributing guidelinesbefore raising an issue, or writing code for the project.LicenseAlignak WebUI is available under theGPL version 3.
alignak-webui-graphite
Shinken / Alignak WebUI module for the Graphite graphsShinken / Alignak module for viewing Graphite graphs in the Web UI.This module is a refactoring of theui-graphitemodule to allow using it with Shinken or Alignak.This module allows:to define the Graphite hierarchy configurationto use templates (url or json based) for the graphsto configure:the host check metric namegraph and font size for dashboard and host/service page graphsdefine if warning, critical, min and max thresholds are present on graphsdefine warning, critical, min and max lines colorsdefine graphs timezone (default is Europe/Paris)define graphs line mode (connected, staircase, slope)This module is fully compatible with the WebUI2 at its most recent version (Alignak compatible). It is also compatible with the Alignak inner metrics module for the Graphite hierarchy.InstallationThe installation of this module will copy some configuration files in the Alignak default configuration directory (eg./usr/local/share/alignak). The copied files are located in the default sub-directory used for the modules (eg.arbiter/modules).Notethat the module provided templates will be copied to the/usr/local/share/alignak/etc/modules/ui-graphite-templates. You may add your own templates in this directory -)From PyPITo install the module from PyPI:sudo pip install alignak_webui_graphiteFrom source filesTo install the module from the source files (for developing purpose):git clone https://github.com/mohierf/mod-ui-graphite cd mod-ui-graphite sudo pip install . -eBugs, issues and contributingContributions to this project are welcome and encouraged …issues in the project repositoryare the common way to raise an information.
align-benchmark
text-alignment-benchmarksBenchmark dualtext (para/sent) alignmentInstall itpipinstallalign-benchmark# or poetry add align-benchmark# pip install git+htts://github.com/ffreemt/text-alignment-benchmarks# poetry add git+htts://github.com/ffreemt/text-alignment-benchmarks# To upgradepipinstallalign-benchmark-U# or poetry add align-benchmark@latestUse itfromalign_benchmark.benchmarkimportbenchmarkbenchmark()or from command linealign-benchmark# or python -m align_benchmark
aligncov
AlignCovAlignCov is a bioinformatics tool which can be used to obtain a) alignment summary statistics and b) read depths from sorted BAM files in tidy tab-separated tables.Future plansCreate a Bioconda recipeCreate a Docker imageIntroductionThis script takes a sorted BAM file as input and usesSAMtoolsand PythonPandasto generate two tables:_stats.tsv: A table of alignment summary statistics, including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov).target: Name of the target.seqlen: Length of the target sequence (bp).depth: Total number of base pairs mapped to the target.len_cov: Total number of base pairs within the target that are covered by at least one mapped read.prop_cov: Proportion of the target length covered by at least one mapped read (len_cov / seqlen).fold_cov: Fold-coverage of mapped reads to the target (i.e. the number of times the target is completely covered by mapped reads) (depth / seqlen)._depth.tsv: A table of read depths for each bp position of each target.target: Name of the target.position: Base pair position within the target.depth: Total number of reads aligned to the base pair position within the target.Dependenciessamtools>=1.15InstallationAlignCov can be installed using Pip with the following command:pipinstallaligncovUsageQuick startFor a sorted BAM file named 'bacillus.bam', compute alignment statistics and read depths, and save results to files named 'subtilis_stats.tsv' and 'subtilis_depth.tsv':$aligncov-ibacillus.bam-osubtilisMore optionsTo show the program's help message:$ aligncov -h usage: aligncov [-h] -i INPUT [-o OUTPUT] Parse a sorted BAM file to generate two tables: a table of alignment summary statistics ('_stats.tsv'), including fold-coverages (fold_cov) and proportions of target lengths covered by mapped reads (prop_cov), and a table of read depths ('_depth.tsv') for each bp position of each target. options: -h, --help show this help message and exit Required: -i INPUT, --input INPUT Path to sorted BAM file to process. Optional: -o OUTPUT, --output OUTPUT Path and base name of files to save as tab-separated tables ('[output]_stats.tsv', '[output]_depth.tsv'). Default: 'sample'CreditsPackagesPandas: McKinney W. 2011. Pandas: A foundation python library for data analysis and statistics. Python for High Performance and Scientific Computing 1–9.DependenciesSAMtools: Danecek P, Bonfield JK, Liddle J, Marshall J, Ohan V, Pollard MO, Whitwham A, Keane T, McCarthy SA, Davies RM, Li H. 2021. Twelve years of SAMtools and BCFtools. GigaScience 10(2) giab008. doi:10.1093/gigascience/giab008Project structureThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.======= History0.0.2 (2023-08-13)Improved/fixed documentation on GitHub and PyPI.0.0.1 (2023-08-12)First release on PyPI.
aligned
AlignedA data managment tool for ML applications.Similar to have DBT is a data managment tool for business analytics, will Aligned manage ML projects. Therefore, Aligned makes it possible to collect data lineage between models, feature transformations etc. While also making it easy to reduce data leakage with point-in-time valid data and fix other problems described inSculley et al. [2015].DocsCheck out theAligned Docs, but keep in mind that they are still work in progress.Want to look at examples of how to usealigned? View theMatsMoll/aligned-examplerepo.This is done by providing an new innovative way to describe how data flow in ML systems, and what our ML products produce. While also collecting dependency metadata that would otherwise be too inconvenient and error prone to manually type out.Therefore, you get the following:Data FreshnessData Quality AssuranceEasy Data LoadingLoad Form Multiple SourcesFeature StoreFeature ServerStream ProcessingModel Performance Monitoring - Documentation coming soonData Catalog - Documentation coming soonData Lineage - Documentation coming soonAll from the simple API of definingData SourcesFeature ViewsModelsAs a result, loading model features is as easy as:entities={"passenger_id":[1,2,3,4]}awaitstore.model("titanic").features_for(entities).to_pandas()Aligned is still in active development, so changes are likely.Feature ViewsWrite features as the should be, as data models. Then get code completion and typesafety by referencing them in other features.This makes the features light weight, data source indipendent, and flexible.@feature_view(name="passenger",description="Some features from the titanic dataset",source=FileSource.csv_at("titanic.csv"),materialized_source=FileSource.parquet_at("titanic.parquet"),)classTitanicPassenger:passenger_id=Int32().as_entity()age=(Float().description("A float as some have decimals").lower_bound(0).upper_bound(110))name=String()sex=String().accepted_values(["male","female"])survived=Bool().description("If the passenger survived")sibsp=Int32().lower_bound(0).description("Number of siblings on titanic")cabin=String().is_optional()# Creates two one hot encoded valuesis_male,is_female=sex.one_hot_encode(['male','female'])Data sourcesAlinged makes handling data sources easy, as you do not have to think about how it is done. Only define where the data is, and we handle the dirty work.Furthermore, you can also add materialised sources which can be used as intermediate sources.my_db=PostgreSQLConfig(env_var="DATABASE_URL")redis=RedisConfig(env_var="REDIS_URL")@feature_view(name="passenger",description="Some features from the titanic dataset",source=my_db.table("passenger",mapping_keys={"Passenger_Id":"passenger_id"}),materialized_source=my_db.with_schema("inter").table("passenger"),stream_source=redis.stream(topic="titanic"))classTitanicPassenger:passenger_id=Int32().as_entity()# Some features...Fast developmentMaking iterativ and fast exploration in ML is important. This is why Aligned also makes it super easy to combine, and test multiple sources.my_db=PostgreSQLConfig.localhost()aws_bucket=AwsS3Config(...)@feature_view(name="passengers",description="...",source=my_db.table("passengers"))classTitanicPassenger:passenger_id=Int32().as_entity()# Some features...# Change data sourcepassenger_view=TitanicPassenger.query()psql_passengers=awaitpassenger_view.all().to_pandas()aws_passengers=awaitpassenger_view.using_source(aws_bucket.parquet_at("passengers.parquet")).to_pandas()Describe ModelsUsually will you need to combine multiple features for each model. This is where aModelcomes in. Here can you define which features should be exposed.passenger=TitanicPassenger()location=LocationFeatures()@model_contract(name="titanic",features=[# aka. the model inputpassenger.constant_filled_age,passenger.ordinal_sex,passenger.sibsp,location.distance_to_shore,location.distance_to_closest_boat])classTitanic:# Referencing the passenger's survived feature as the targetdid_survive=passenger.survived.as_classification_target()Data FreshnessMaking sure a source contains fresh data is a crucial part to create propper ML applications. Therefore, Aligned provides an easy way to check how fresh a source is.@feature_view(name="departures",description="Features related to the departure of a taxi ride",source=taxi_db.table("departures"),)classTaxiDepartures:trip_id=UUID().as_entity()pickuped_at=EventTimestamp()number_of_passengers=Int32()dropoff_latitude=Float().is_required()dropoff_longitude=Float().is_required()pickup_latitude=Float().is_required()pickup_longitude=Float().is_required()freshness=awaitTaxiDepartures.freshness_in_batch_source()iffreshness<datetime.now()-timedelta(days=2):raiseValueError("To old data to create an ML model")Access DataYou can easily create a feature store that contains all your feature definitions. This can then be used to genreate data sets, setup an instce to serve features, DAG's etc.store=awaitFileSource.json_at("./feature-store.json").feature_store()# Select all features from a single feature viewdf=awaitstore.all_for("passenger",limit=100).to_pandas()Centraliced Feature Store DefinitionYou would often share the features with other coworkers, or split them into different stages, likestaging,shadow, orproduction. One option is therefore to reference the storage you use, and load theFeatureStorefrom there.aws_bucket=AwsS3Config(...)store=awaitaws_bucket.json_at("production.json").feature_store()# This switches from the production online store to the offline store# Aka. the batch sources defined on the feature viewsexperimental_store=store.offline_store()This json file can be generated by runningaligned apply.Select multiple feature viewsdf=awaitstore.features_for({"passenger_id":[1,50,110]},features=["passenger:scaled_age","passenger:is_male","passenger:sibsp""other_features:distance_to_closest_boat",]).to_polars()Model ServiceSelecting features for a model is super simple.df=awaitstore.model("titanic_model").features_for({"passenger_id":[1,50,110]}).to_pandas()Feature ViewIf you want to only select features for a specific feature view, then this is also possible.prev_30_days=awaitstore.feature_view("match").previous(days=30).to_pandas()sample_of_20=awaitstore.feature_view("match").all(limit=20).to_pandas()Data qualityAlinged will make sure all the different features gets formatted as the correct datatype. In addition will aligned also make sure that the returend features aligne with defined constraints.@feature_view(...)classTitanicPassenger:...age=(Float().is_required().lower_bound(0).upper_bound(110))sibsp=Int32().lower_bound(0,is_inclusive=True)Then since our feature view have ais_requiredand alower_bound, will the.validate(...)command filter out the entites that do not follow that behavior.fromaligned.validation.panderaimportPanderaValidatordf=awaitstore.model("titanic_model").features_for({"passenger_id":[1,50,110]}).validate(PanderaValidator()# Validates all features).to_pandas()Feature ServerYou can define how to serve your features with theFeatureServer. Here can you define where you want to load, and potentially write your features to.By default will italignedlook for a file calledserver.py, and aFeatureServerobject calledserver. However, this can be defined manually as well.fromalignedimportRedisConfig,FileSourcefromaligned.schemas.repo_definitionimportFeatureServerstore=FileSource.json_at("feature-store.json")server=FeatureServer.from_reference(store,RedisConfig.localhost())Then runaligned serve, and a FastAPI server will start. Here can you push new features, which then transforms and stores the features, or just fetch them.Stream WorkerYou can also setup stream processing with a similar structure. However, here will aStreamWorkerbe used.by default willalignedlook for aworker.pyfile with an object calledworker. An example would be the following.fromalignedimportRedisConfig,FileSourcefromaligned.schemas.repo_definitionimportFeatureServerstore=FileSource.json_at("feature-store.json")server=FeatureServer.from_reference(store,RedisConfig.localhost())
aligned-bert-embedder
get_aligned_BERT_embGet the aligned BERT embedding for sequence labeling tasksInstalling as a dependencypipinstallaligned-bert-embedderInstalling dependenciescondaenvcreate-fenvironment.ymlExample of usage from cmd (not recommended):python-maligned_bert_embedderembedaligned_bert_embedder/configs/snip.ymlaligned_bert_embedder/texts/triple.txtExample of usage from code (preferable)fromaligned_bert_embedderimportAlignedBertEmbedderembeddings=AlignedBertEmbedder(config).embed((('First',`sentence`,`or`,`other`,`context`,`chunk`),(`Second`,`sentence`)))The following is the content of the originalREADME.mdfile from the developer repo.Why this repo?In the origin scriptextract_features.pyin BERT, tokens may be splited into pieces as follows:orig_tokens=["John","Johanson","'s","house"]bert_tokens=["[CLS]","john","johan","##son","'","s","house","[SEP]"]orig_to_tok_map=[1,2,4,6]We investigate 3 align strategies (first,meanandmax) to maintain an original-to-tokenized alignment. Take the "Johanson->johan,##son" as example:first: take the representation ofjohanas the whole wordJohansonmean: take the reduce_mean value of representations ofjohanand##sonas the whole wordJohansonmax: take the reduce_max value of representations ofjohanand##sonas the whole wordJohansonHow to use this repo?shrun.shinput_fileoutout_fileBERT_BASE_DIR# For example:shrun.shyou_datayou_data.bertpath/to/bert/uncased_L-12_H-768_A-12You can modifylayersandalign_strategiesin therun.sh.How to load the output embeddings?After the above procedure, you are expected to get a output file of contextual embeddings (e.g., your_data_6_mean). Then you can load this file like conventional word embeddings. For example in a python script:withopen("your_data_6_mean","r",encoding="utf-8")asbert_f"forlineinbert_f:bert_vec=[[float(value)forvalueintoken.split()]fortokeninline.strip().split("|||")]
aligned-textgrid
Aligned TextGridThe aligned-textgrid package provides a python interface for representing and operating on TextGrids produced by forced aligners likeFAVEor theMontreal Forced Aligner. Classes provided by aligned-textgrid represent hierarchical and precedence relationships among data stored in TextGrid formats allowing for simplified and more accessible analysis of aligned speech data.Example Use CasesYou want to quickly loop through the Phone tier of a Textgrid, andalsoaccess information about the word it is a part of.You want to quickly loop over the Word tier of a Textgrid and quickly count how many phones it has.You want to programmatically merge together adjacent Textgrid intervals.For examples on how to use the pacakge, see theUsagepages.InstallationTo install aligned-textgrid using pip, run the following command in your terminal:pipinstallaligned-textgridNot another TextGrid implementationThere are several other packages that parse Praat Textgrids, includingpraatiotextgridaligned-textgrid’s goal is to capture hierarchical and sequential relationships represented in many TextGrids, and to make them easilly accessible to users via an intuitive interface. The goal is that from any arbitrary location within a TextGrid, users can easilly access information with minimally defensive coding.ExampleAs an example, we’ll read in a textgrid produced with forced alignment that contains a single speaker with a word and phone tier.fromaligned_textgridimportAlignedTextGrid,Word,Phonetg=AlignedTextGrid(textgrid_path='doc_src/usage/resources/josef-fruehwald_speaker.TextGrid',entry_classes=[Word,Phone])Then, we can access an arbitrary phone interval.arbitrary_interval=tg[0].Phone[20]From this aribitrary interval, we can access information about the intervals preceding and following with the.prevand.folattributes.print(arbitrary_interval.prev.label)print(arbitrary_interval.label)print(arbitrary_interval.fol.label)R EY1 NWe can also access information about the word this interval is nested within with the.inwordattribute.print(arbitrary_interval.inword.label)raindropsThe object returned by.inwordis just another interval, meaning we can access informaton aboutit’scontext with the.prevand.folattributes as well.print(arbitrary_interval.inword.prev.label)print(arbitrary_interval.inword.label)print(arbitrary_interval.inword.fol.label)strikes raindrops inFor moreTo start jumping in, check outthe quickstartTo learn more about navigating TextGrids and intervals, check out the usage pages onnavigating TextGridsandnavgiating sequencesTo learn more about the attributes you can access from textgrids and sequences, see the usage pages onTextGrid attributesandinterval attributesYou can also directly read up onthe function and class references.
aligned-text-table
Aligned text tableA parser for tables in plain text that are aligned with spaces, e.g.:This is Column two This one column one is column threeUsage>>> from aligned_text_table import parse_row >>> parse_row( ... lines=[ ... "This is Column two This one ", ... "column one is column", ... "three " ... ], ... keys=["one", "two", "three"] ... ) { "one": "This is column one", "two": "Column two", "three": "This one is column three" }TestsTo run tests, install and run Tox:pip3 install tox tox
aligned-treemap
Pure Python implementation of treemap, aligned_treemap, and squarify
aligner
No description available on PyPI.
aligner-pytorch
Aligner - PyTorchSequence alignement methods with helpers for PyTorch.Installpipinstallaligner-pytorchUsageMASMAS (Monotonic Alignment Search) from GlowTTS. This can be used to get the alignment of any (similarity) matrix. Implementation in optimized Cython.fromaligner_pytorchimportmassim=torch.rand(1,4,6)# [batch_size, x_length, y_length]alignment=mas(sim)"""sim = tensor([[[0.2, 0.8, 0.9, 0.9, 0.9, 0.4],[0.6, 0.8, 0.9, 0.7, 0.1, 0.4],[1.0, 0.4, 0.4, 0.2, 1.0, 0.7],[0.1, 0.3, 0.1, 0.7, 0.6, 0.9]]])alignment = tensor([[[1, 0, 0, 0, 0, 0],[0, 1, 1, 1, 0, 0],[0, 0, 0, 0, 1, 0],[0, 0, 0, 0, 0, 1]]], dtype=torch.int32)"""XY Embedding to AlignmentUsed during training to get the alignement of ax_embeddingwithy_embedding, computes the log probability from a normal distribution and the alignment with MAS.fromaligner_pytorchimportget_alignment_from_embeddingsx_embedding=torch.randn(1,4,10)y_embedding=torch.randn(1,6,10)alignment=get_alignment_from_embeddings(x_embedding=torch.randn(1,4,10),# [batch_size, x_length, features]y_embedding=torch.randn(1,6,10),# [batch_size, y_length, features])# [batch_size, x_length, y_length]"""alignment = tensor([[[1, 0, 0, 0, 0, 0],[0, 1, 0, 0, 0, 0],[0, 0, 1, 0, 0, 0],[0, 0, 0, 1, 1, 1]]], dtype=torch.int32)"""Duration Embedding to AlignmentUsed during inference to compute the alignment from a trained duration embedding.fromaligner_pytorchimportget_alignment_from_duration_embeddingalignment=get_alignment_from_duration_embedding(embedding=torch.randn(1,5),# Embedding: [batch_size, x_length]scale=1.0,# Duration scaley_length=10# (Optional) fixes maximum output y_length)# Output alignment [batch_size, x_length, y_length]"""alignment = tensor([[[1, 1, 1, 0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 1, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 1, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 1, 1, 1, 0, 0],[0, 0, 0, 0, 0, 0, 0, 0, 1, 0]]])"""CitationsMonotonic Alignment Search@misc{2005.11129,Author={Jaehyeon Kim and Sungwon Kim and Jungil Kong and Sungroh Yoon},Title={Glow-TTS: A Generative Flow for Text-to-Speech via Monotonic Alignment Search},Year={2020},Eprint={arXiv:2005.11129},}
alignfig-estimator
No description available on PyPI.
aligning
No description available on PyPI.
aligni-python
Aligni PythonSource Code:https://github.com/mnorman-dev/aligni-pythonPyPI:https://pypi.org/project/aligni-python/Python library for interfacing to the Aligni (PLM/MRP) API v2Full documentation of the underlying API is available at:https://api.aligni.com/v2/index.htmlWARNINGThis code should be considered beta level at best. A good understanding of the underlying api is required to understand the data available for each datatype.UsageBelow is a simple example of how to use this interface to query the parts in a library. This example uses the demo Aligni site athttps://demo.aligni.com/.importaligni.apiif__name__=="__main__":sitename="demo"# Replace with sitename of Aligni accountapikey="oid3vLgynoy_Yl1gZkrgkLEq3J"# Replace with API Key created from Aligni accountaligni_api=aligni.api.API(sitename,apikey)aligni_parts=aligni_api.parts.get_list()aligni_total_part_count=len(aligni_parts)print("Aligni Part Count =",aligni_total_part_count)Refer to tests to see further examples.Installationpipinstallaligni-pythonDevelopmentClone this repositoryRequirements:PoetryPython 3.7+Create a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellTestingpytestPre-commitPre-commit hooks run all the auto-formatters (e.g.black,isort), linters (e.g.mypy,flake8), and other quality checks to make sure the changeset is in good shape before a commit/push happens.You can install the hooks with (runs for each commit):pre-commitinstallOr if you want them to run only for each push:pre-commitinstall-tpre-pushOr if you want e.g. want to run all checks manually for all files:pre-commitrun--all-files
alignlib
alignlibA small Python module providing edit distance and Hamming distance computation.
alignlib-lite
alignlib - python wrapped C++ library around sequence alignment
alignme
FeaturesTODOInstallationYou can installalignmeviapipfromPyPI:$pipinstallalignmeUsagePlease see theCommand-line Referencefor details.CreditsThis package was created withcookietempleusingCookiecutterbased onHypermodern_Python_Cookiecutter.
alignmeet
ALIGNMEETA Comprehensive Tool for Meeting Annotation, Alignment, and EvaluationInstallationPrerequisitesWindowsinstall Python >=3.6https://www.python.org/downloads/install VLC (install matching version with your system, i.e., x64 or x86):VLC x86:https://get.videolan.org/vlc/3.0.16/win32/vlc-3.0.16-win32.exeVLC x64:https://get.videolan.org/vlc/3.0.16/win64/vlc-3.0.16-win64.exein order to run the program from the command line, make sure you have Python Scritp folder in your PATH, e.g.:C:\Users\USER_NAME\AppData\Roaming\Python\Python39\ScriptsLinuxInstall the latest version of VLC:apt-get update && apt-get install ffmpeg vlcPipUse this installation mode if you want the latest released version from PyPI:pip install alignmeetUpdatingpip install --upgrade alignmeetUser guideRunning ALIGNMEETJust open a command line or typeWindows+Ron Windows and typealignmeet.Creating a new meetingGoFile → New(or just typeCtrl+N) and go to the folder where the meetings are stored. By left-clicking in this folder, you can create a new empty folder. Name this folder according to the meeting’s name. After you create the new empty folder, select it. The program creates a structure for the meeting:./(root folder)You can place a recording of the meeting in any reasonable format supported by VLC (can be either audio or video)transcriptsEach file in this folder is a transcript.Transcript file is a plain text file.If you have an existing transcript, just copy & paste it to this folder. Additionally, if the file comes with DAs annotated with speakers (speaker must be annotated at the beginning of the line in brackets, e.g., (Speaker) ), the program will extract this information.Format of a DA:A semicolon-separated, one DA per lineDA;SPEAKER;START_IN_S;END_IN_SminutesSummaries/Minutes are stored in plaintext files, each minute per line.Other information regarding the meeting can be included in this file in any (plaintext) form (e.g., annotator name, attendees, date, purpose of the meeting, …).annotationsPairing between summaries/minutes and transcripts.For specific transcript-minutes pair there is a file with the name “{transcript_file}+{minutes_file}”Each file has 3 columns: DA ID, minute ID and ProblemThe second and third column can contain “None” value (i.e., when either minute or problem is selected only)Opening an existing meetingGoFile → Open(or just typeCtrl+O) and select the root folder of a meeting. It will show you the meeting summary and transcript to annotate.User guide for annotationProgram layoutA. Transcript panelB. Summary panelC. Other annotations (e.g., problems like incomprehensible speech or small talk)D. Meeting recording playbackAlignment annotationSelect a single DA (dialogue act = one numbered line in the transcript) by clicking on it, or select multiple DAs by press-and-hold (or Shift and clicking). To pair the selected DA(s) to a summary unit, double click on the corresponding line in the Summary panel (B). The pairing is represented by the corresponding background colors of the DAs and summary units.Similarly, to mark a DA(s) with a problem, select the DA(s) as previously discussed and double click on a problem (C). The annotated problem will be in the right “Problem” column.Altering the annotationYou can select DA(s) and pair them with another summary unit/problem.Or you can reset selected option, just click the right mouse button. From the context menu choose the optionReset minutesorReset problems(you can also use the shortcuts displayed in the context menu).Edit transcriptIt is possible to make changes in the transcribed text after you select an option Edit transcript shown in the picture. For inserting/deleting use right mouse button and choose an appropriate option from the shown context menuAltering summaryEditing of the summary is possible the same way as in the transcript, for inserting/deleting or indenting to the right/left use right mouse button and choose an appropriate option from the shown context menuProblems/OtherYou can annotate DA(s) with a problem from a panelOther.We distinguish four types of typical cases when the DA(s) cannot be easily aligned to a summary unit. This list can be changed if needed. We plan to make this list editable by the user.OrganizationalParts related to the organization of the meeting or project itself.E.g., information about the present or missing participants at the meeting, or sentences like:"Okay, I’ll write it to the agenda'' "So that’s resolved and now, we can continue because time is really running"Speech incomprehensibleIf you don’t understand what was said.See separate commentIf nothing from the other options is concise enough, please select it as See separate comment and write your note to the corresponding part to Anna [email protected] talkFor parts non-related to the minutes or organization of the meeting or the project itself (e.g., I noticed some topics about Covid and so on…)Recording/VideoIf the meetings has a recording you can use playback panel. You can use the panel, main menuPlaybackor keyboard shortcuts (see the actual shortcuts in the main menu).Git integrationTo distribute and synchronize annotation among annotators, you can use Git integration. ALIGNMEET can pull and push changes to a given Git repository.After the setup, user/annotator just clicks File -> Open repository (Ctrl + G). The tool pulls the recent version of the repository and opens a dialog window to select a meeting (the repository might contain more meetings).To commit the changes, go File -> Save (Ctrl + S). The tool saves the changes to the local copy and pushes them as a new commit to the remote repository. TheAnnotator namein Settings is used as a commit message.SetupInstall Git client on the annotator's computer and include it in thePATHvariable.You can use any remote Git repository. The repository might contain one or more meetings. If you have more meetings, create a folder per meeting.Each annotator must fill these settings:SettingDescriptionAnnotator namewill be used as commit messageRepo locationthe location of the local copyRepositorylink to Git repositoryRepo userGit user with R/W access to the repositoryRepo tokenPersonal access token for the user (see below)Personal access tokenThe Git user that will have R/W access to the repository must create a Personal access token.In Github go to Settings -> Developer settings -> Personal access tokens -> New personal access token. Set a note and set an expiration date. Copy the token and distribute it to the annotators. You might want to create a separate token per annotator, so you can revoke individual annotator access. You might also want to create a separate Git user for security reasons.AttributionSome icons byYusuke Kamiyamane. Licensed under aCreative Commons Attribution 3.0 License.
alignment
Alignment is a native Python library for generic sequence alignment. It is useful in cases where your alphabet is arbitrarily large and you cannot use traditional biological sequence analysis tools. It supports global and local pairwise sequence alignment. I also plan to add support for profile-profile alignments, but who knows when.InstallationYou can install the most recent release using pip:pip install alignmentUsageTypical usage looks like this:from alignment.sequence import Sequence from alignment.vocabulary import Vocabulary from alignment.sequencealigner import SimpleScoring, GlobalSequenceAligner # Create sequences to be aligned. a = Sequence('what a beautiful day'.split()) b = Sequence('what a disappointingly bad day'.split()) # Create a vocabulary and encode the sequences. v = Vocabulary() aEncoded = v.encodeSequence(a) bEncoded = v.encodeSequence(b) # Create a scoring and align the sequences using global aligner. scoring = SimpleScoring(2, -1) aligner = GlobalSequenceAligner(scoring, -2) score, encodeds = aligner.align(aEncoded, bEncoded, backtrace=True) # Iterate over optimal alignments and print them. for encoded in encodeds: alignment = v.decodeSequenceAlignment(encoded) print alignment print 'Alignment score:', alignment.score print 'Percent identity:', alignment.percentIdentity() printTODO ListProfile-profile alignment is not working yet.
alignment-handbook
🤗Models & Datasets| 📃Technical ReportThe Alignment HandbookRobust recipes to align language models with human and AI preferences.What is this?Just one year ago, chatbots were out of fashion and most people hadn't heard about techniques like Reinforcement Learning from Human Feedback (RLHF) to align language models with human preferences. Then, OpenAI broke the internet with ChatGPT and Meta followed suit by releasing the Llama series of language models which enabled the ML community to build their very own capable chatbots. This has led to a rich ecosystem of datasets and models that have mostly focused on teaching language models to follow instructions through supervised fine-tuning (SFT).However, we know from theInstructGPTandLlama2papers that significant gains in helpfulness and safety can be had by augmenting SFT with human (or AI) preferences. At the same time, aligning language models to a set of preferences is a fairly novel idea and there are few public resources available on how to train these models, what data to collect, and what metrics to measure for best downstream performance.The Alignment Handbook aims to fill that gap by providing the community with a series of robust training recipes that span the whole pipeline.News 🗞️November 10, 2023:We release all the training code to replicate Zephyr-7b-β 🪁! We also releaseNo Robots, a brand new dataset of 10,000 instructions and demonstrations written entirely by skilled human annotators.Links 🔗Zephyr 7B models, datasets, and demosHow to navigate this project 🧭This project is simple by design and mostly consists of:scriptsto train and evaluate chat models. Each script supports distributed training of the full model weights with DeepSpeed ZeRO-3, or LoRA/QLoRA for parameter-efficient fine-tuning.recipesto reproduce models like Zephyr 7B. Each recipe takes the form of a YAML file which contains all the parameters associated with a single training run.We are also working on a series of guides to explain how methods like direct preference optimization (DPO) work, along with lessons learned from gathering human preferences in practice. To get started, we recommend the following:Follow theinstallation instructionsto set up your environment etc.Replicate Zephyr-7b-β by following therecipe instructions.If you would like to train chat models on your own datasets, we recommend following the dataset formatting instructionshere.ContentsThe initial release of the handbook will focus on the following techniques:Supervised fine-tuning:teach language models to follow instructions and tips on how to collect and curate your own training dataset.Reward modeling:teach language models to distinguish model responses according to human or AI preferences.Rejection sampling:a simple, but powerful technique to boost the performance of your SFT model.Direct preference optimisation (DPO):a powerful and promising alternative to PPO.Installation instructionsTo run the code in this project, first, create a Python virtual environment using e.g. Conda:condacreate-nhandbookpython=3.10&&condaactivatehandbookNext, install PyTorchv2.1.0- the precise version is important for reproducibility! Since this is hardware-dependent, we direct you to thePyTorch Installation Page.You can then install the remaining package dependencies as follows:gitclonehttps://github.com/huggingface/alignment-handbook.gitcd./alignment-handbook/ python-mpipinstall.You will also need Flash Attention 2 installed, which can be done by running:NoteIf your machine has less than 96GB of RAM and many CPU cores, reduce the MAX_JOBS., e.g.MAX_JOBS=4 pip install flash-attn --no-build-isolationpython-mpipinstallflash-attn--no-build-isolationNext, log into your Hugging Face account as follows:huggingface-cliloginFinally, install Git LFS so that you can push models to the Hugging Face Hub:sudoapt-getinstallgit-lfsYou can now check out thescriptsandrecipesdirectories for instructions on how to train some models 🪁!Project structure├── LICENSE ├── Makefile <- Makefile with commands like `make style` ├── README.md <- The top-level README for developers using this project ├── chapters <- Educational content to render on hf.co/learn ├── recipes <- Recipe configs, accelerate configs, slurm scripts ├── scripts <- Scripts to train and evaluate chat models ├── setup.cfg <- Installation config (mostly used for configuring code quality & tests) ├── setup.py <- Makes project pip installable (pip install -e .) so `alignment` can be imported ├── src <- Source code for use in this project └── tests <- Unit testsCitationIf you find the content of this repo useful in your work, please cite it as follows:@misc{alignment_handbook2023,author={Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Alexander M. Rush and Thomas Wolf},title={The Alignment Handbook},year={2023},publisher={GitHub},journal={GitHub repository},howpublished={\url{https://github.com/huggingface/alignment-handbook}}}
alignmentrs
alignmentrsQuickly read and manipulate multiple sequence alignments in PythonInstallationpip install alignmentrsQuickstartImport alignment into Python>>>importalignmentrsasrs>>>aln=rs.Alignment.from_fasta('hiv.fna','HIV_alignment')>>>alnAlignment(nsamples=10,nsites=120,nmarkers=0)>>>aln.sample_ids['sample01','sample02','sample03','sample04','sample05','sample06''sample07','sample08','sample09','sample10']Select sites to remove from the alignment>>>sites_to_remove=[iforiinrange(120)if(i-2)%3!=0]# remove 1st and 2nd position in codon triplet>>>aln.remove_sites(sites_to_remove,copy=False)# manipulate inplace, copy=True returns a new copyAlignment(nsamples=10,nsites=40,nmarkers=0)Select sites to retain in the alignment>>>sites_to_retain=list(range(2,3,120))# third position in codon triplet>>>aln.retain_sites(sites_to_retain,copy=False)# manipulate inplace, copy=True returns a new copyAlignment(nsamples=10,nsites=40,nmarkers=0)Get a subset of samples and sites>>>sub_aln=aln.subset(samples=['sample01','sample03','sample05'],sites=list(range(2,3,120)))>>>sub_alnAlignment(nsamples=3,nsites=40,nmarkers=0)LicenseMIT License
alignments
No description available on PyPI.
alignn
Table of ContentsIntroductionInstallationExamplesPre-trained modelsQuick start using colabJARVIS-ALIGNN webappALIGNN-FF & ASE CalculatorPeformances on a few datasetsUseful notesReferencesHow to contributeCorrespondenceFunding supportALIGNN (Introduction)The Atomistic Line Graph Neural Network (https://www.nature.com/articles/s41524-021-00650-1) introduces a new graph convolution layer that explicitly models both two and three body interactions in atomistic systems.This is achieved by composing two edge-gated graph convolution layers, the first applied to the atomistic line graphL(g)(representing triplet interactions) and the second applied to the atomistic bond graphg(representing pair interactions).The atomistic graphgconsists of a node for each atomi(with atom/node representationshi), and one edge for each atom pair within a cutoff radius (with bond/pair representationseij).The atomistic line graphL(g)represents relationships between atom triplets: it has nodes corresponding to bonds (sharing representationseijwith those ing) and edges corresponding to bond angles (with angle/triplet representationstijk).The line graph convolution updates the triplet representations and the pair representations; the direct graph convolution further updates the pair representations and the atom representations.InstallationFirst create a conda environment: Install miniconda environment fromhttps://conda.io/miniconda.htmlBased on your system requirements, you'll get a file something like 'Miniconda3-latest-XYZ'.Now,bash Miniconda3-latest-Linux-x86_64.sh (for linux) bash Miniconda3-latest-MacOSX-x86_64.sh (for Mac)Download 32/64 bit python 3.10 miniconda exe and install (for windows) Now, let's make a conda environment, say "version", choose other name as you like::conda create --name version python=3.10 source activate versionoptional GPU dependenciesIf you need CUDA support, it's best to install PyTorch and DGL before installing alignn to ensure that you get a CUDA-enabled version of DGL.To [install the stable release of PyTorch] on linux with cudatoolkit 11.8 runconda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidiaTheninstall the matching DGL versionconda install -c dglteam/label/cu118 dglSome of our models may not be stable with the latest DGL release (v1.1.0) so you may wish to install v1.0.2 instead:conda install -c dglteam/label/cu118 dgl==1.0.2.cu118Method 1 (editable in-place install)You can install a development version of alignn by cloning the repository and installing in place with pip:git clone https://github.com/usnistgov/alignn cd alignn python -m pip install -e .Method 2 (using pypi):As an alternate method, ALIGNN can also be installed usingpipcommand as follows:pip install alignn pip install dgl==1.0.1+cu117 -f https://data.dgl.ai/wheels/cu117/repo.htmlExamplesDatasetThe main script to train model istrain_folder.py. A user needs at least the following info to train a model: 1)id_prop.csvwith name of the file and corresponding value, 2)config_example.jsona config file with training and hyperparameters.Users can keep their structure files inPOSCAR,.cif,.xyzor.pdbfiles in a directory. In the examples below we will use POSCAR format files. In the same directory, there should be anid_prop.csvfile.In this directory,id_prop.csv, the filenames, and correponding target values are kept incomma separated values (csv) format.Here is an example of training OptB88vdw bandgaps of 50 materials from JARVIS-DFT database. The example is created using thegenerate_sample_data_reg.pyscript. Users can modify the script for more than 50 data, or make their own dataset in this format. For list of available datasets seeDatabases.The dataset in split in 80:10:10 as training-validation-test set (controlled bytrain_ratio, val_ratio, test_ratio) . To change the split proportion and other parameters, change theconfig_example.jsonfile. If, users want to train on certain sets and val/test on another dataset, setn_train,n_val,n_testmanually in theconfig_example.jsonand also setkeep_data_orderas True there so that random shuffle is disabled.A brief help guide (-h) can be obtained as follows.train_folder.py -hRegression exampleNow, the model is trained as follows. Please increase thebatch_sizeparameter to something like 32 or 64 inconfig_example.jsonfor general trainings.train_folder.py --root_dir "alignn/examples/sample_data" --config "alignn/examples/sample_data/config_example.json" --output_dir=tempClassification exampleWhile the above example is for regression, the follwoing example shows a classification task for metal/non-metal based on the above bandgap values. We transform the dataset into 1 or 0 based on a threshold of 0.01 eV (controlled by the parameter,classification_threshold) and train a similar classification model. Currently, the script allows binary classification tasks only.train_folder.py --root_dir "alignn/examples/sample_data" --classification_threshold 0.01 --config "alignn/examples/sample_data/config_example.json" --output_dir=tempMulti-output model exampleWhile the above example regression was for single-output values, we can train multi-output regression models as well. An example is given below for training formation energy per atom, bandgap and total energy per atom simulataneously. The script to generate the example data is provided in the script folder of the sample_data_multi_prop. Another example of training electron and phonon density of states is provided also.train_folder.py --root_dir "alignn/examples/sample_data_multi_prop" --config "alignn/examples/sample_data/config_example.json" --output_dir=tempAutomated model trainingUsers can try training using multiple example scripts to run multiple dataset (such as JARVIS-DFT, Materials project, QM9_JCTC etc.). Look into thealignn/scripts/train_*.pyfolder. This is done primarily to make the trainings more automated rather than making folder/ csv files etc. These scripts automatically download datasets fromDatabases in jarvis-toolsand train several models. Make sure you specify your specific queuing system details in the scripts.Using pre-trained modelsAll the trained models are distributed on [Figshare](https://figshare.com/projects/ALIGNN_models/126478.Thepretrained.py scriptcan be applied to use them. These models can be used to directly make predictions.A brief help section (-h) is shown using:pretrained.py -hAn example of prediction formation energy per atom using JARVIS-DFT dataset trained model is shown below:pretrained.py --model_name jv_formation_energy_peratom_alignn --file_format poscar --file_path alignn/examples/sample_data/POSCAR-JVASP-10.vaspQuick start using GoogleColab notebook exampleThe followingnotebookprovides an example of 1) installing ALIGNN model, 2) training the example data and 3) using the pretrained models. For this example, you don't need to install alignn package on your local computer/cluster, it requires a gmail account to login. Learn more about Google colabhere.The followingnotebookprovides an example of ALIGNN-FF model.Web-appA basic web-app is for direct-prediction available atJARVIS-ALIGNN app. Given atomistic structure in POSCAR format it predict formation energy, total energy per atom and bandgap using data trained on JARVIS-DFT dataset.ALIGNN-FFASE calculatorprovides interface to various codes. An example for ALIGNN-FF is give below. Note that there are multiple pretrained ALIGNN-FF models available, here we use the deafult_path model. As more accurate models are developed, they will be made available as well:from alignn.ff.ff import AlignnAtomwiseCalculator,default_path model_path = default_path() calc = AlignnAtomwiseCalculator(path=model_path) from ase import Atom, Atoms import numpy as np import matplotlib.pyplot as plt lattice_params = np.linspace(3.5, 3.8) fcc_energies = [] ready = True for a in lattice_params: atoms = Atoms([Atom('Cu', (0, 0, 0))], cell=0.5 * a * np.array([[1.0, 1.0, 0.0], [0.0, 1.0, 1.0], [1.0, 0.0, 1.0]]), pbc=True) atoms.set_tags(np.ones(len(atoms))) atoms.calc = calc e = atoms.get_potential_energy() fcc_energies.append(e) import matplotlib.pyplot as plt %matplotlib inline plt.plot(lattice_params, fcc_energies) plt.title('1x1x1') plt.xlabel('Lattice constant ($\AA$)') plt.ylabel('Total energy (eV)') plt.show()To train ALIGNN-FF usetrain_folder_ff.pyscript which usesatomwise_alignnmodel:AtomWise prediction example which looks for similar setup as before but unstead ofid_prop.csv, it requiresid_prop.jsonfile (see example in the sample_data_ff directory). Note ALIGNN-FF requires energy stored as energy per atom:train_folder_ff.py --root_dir "alignn/examples/sample_data_ff" --config "alignn/examples/sample_data_ff/config_example_atomwise.json" --output_dir=tempA pretrained ALIGNN-FF (under active development right now) can be used for predicting several properties, such as:run_alignn_ff.py --file_path alignn/examples/sample_data/POSCAR-JVASP-10.vasp --task="unrelaxed_energy" run_alignn_ff.py --file_path alignn/examples/sample_data/POSCAR-JVASP-10.vasp --task="optimize" run_alignn_ff.py --file_path alignn/examples/sample_data/POSCAR-JVASP-10.vasp --task="ev_curve"To know about other tasks, type.run_alignn_ff.py -hPerformancesPlease refer toJARVIS-Leaderboardto check the performance of ALIGNN models on several databases.1) On JARVIS-DFT 2021 dataset (classification)ModelThresholdALIGNNMetal/non-metal classifier (OPT)0.01 eV0.92Metal/non-metal classifier (MBJ)0.01 eV0.92Magnetic/non-Magnetic classifier0.05 µB0.91High/low SLME10 %0.83High/low spillage0.10.80Stable/unstable (ehull)0.1 eV0.94High/low-n-Seebeck-100 µVK-10.88High/low-p-Seebeck100 µVK-10.92High/low-n-powerfactor1000 µW(mK2)-10.74High/low-p-powerfactor1000µW(mK2)-10.742) On JARVIS-DFT 2021 dataset (regression)PropertyUnitsMADCFIDCGCNNALIGNNMAD: MAEFormation energyeV(atom)-10.860.140.0630.03326.06Bandgap (OPT)eV0.990.300.200.147.07Total energyeV(atom)-11.780.240.0780.03748.11EhulleV1.140.220.170.07615.00Bandgap (MBJ)eV1.790.530.410.315.77KvGPa52.8014.1214.4710.405.08GvGPa27.1611.9811.759.482.86Mag. momµB1.270.450.370.264.88SLME (%)No unit10.936.225.664.522.42SpillageNo unit0.520.390.400.351.49Kpoint-lengthÅ17.889.6810.609.511.88Plane-wave cutoffeV260.4139.4151.0133.81.95єx (OPT)No unit57.4024.8327.1720.402.81єy (OPT)No unit57.5425.0326.6219.992.88єz (OPT)No unit56.0324.7725.6919.572.86єx (MBJ)No unit64.4330.9629.8224.052.68єy (MBJ)No unit64.5529.8930.1123.652.73єz (MBJ)No unit60.8829.1830.5323.732.57є (DFPT:elec+ionic)No unit45.8143.7138.7828.151.63Max. piezoelectric strain coeff (dij)CN-124.5736.4134.7120.571.19Max. piezo. stress coeff (eij)Cm-20.260.230.190.1471.77Exfoliation energymeV(atom)-162.6363.3150.051.421.22Max. EFG1021Vm-243.9024.5424.719.122.30avg. meelectron mass unit0.220.140.120.0852.59avg. mhelectron mass unit0.410.200.170.1243.31n-SeebeckµVK-1113.056.3849.3240.922.76n-PFµW(mK2)-1697.80521.54552.6442.301.58p-SeebeckµVK-1166.3362.7452.6842.423.92p-PFµW(mK2)-1691.67505.45560.8440.261.573) On Materials project 2018 datasetThe results from models other than ALIGNN are reported as given in corresponding papers, not necessarily reproduced by us.PropUnitMADCFIDCGCNNMEGNetSchNetALIGNNMAD:MAEEfeV(atom)-10.930.1040.0390.0280.0350.02242.27EgeV1.350.4340.3880.33-0.2186.194) On QM9 datasetNote theissuerelated to QM9 dataset. The results from models other than ALIGNN are reported as given in corresponding papers, not necessarily reproduced by us. These models were trained with same parameters as solid-state databases but for 1000 epochs.TargetUnitsSchNetMEGNetDimeNet++ALIGNNHOMOeV0.0410.0430.02460.0214LUMOeV0.0340.0440.01950.0195GapeV0.0630.0660.03260.0381ZPVEeV0.00170.001430.001210.0031µDebye0.0330.050.02970.0146αBohr30.2350.0810.04350.0561R2Bohr20.0730.3020.3310.5432U0eV0.0140.0120.006320.0153UeV0.0190.0130.006280.0144HeV0.0140.0120.006530.0147GeV0.0140.0120.007560.01445) On hMOF datasetPropertyUnitMADMAEMAD:MAER2RMSEGrav. surface aream2g-11430.8291.1515.700.99180.89Vol. surface aream2cm-3561.44107.815.210.91229.24Void fractionNo unit0.160.0179.410.980.03LCDÅ3.440.754.560.831.83PLDÅ3.550.923.860.782.12All adspmol kg-11.700.189.440.950.49Adsp at 0.01barmol kg-10.120.043.000.770.11Adsp at 2.5barmol kg-12.160.484.500.900.976) On qMOF datasetMAE on electronic bandgap 0.20 eV7) On OMDB datasetcoming soon!8) On HOPV datasetcoming soon!9) On QETB datasetcoming soon!10) On OpenCatalyst datasetOn 10k dataset:DataSplitCGCNNDimeNetSchNetDimeNet++ALIGNNMAD: MAE10k0.9881.01171.0590.88370.61-Useful notes (based on some of the queries we received)If you are using GPUs, make sure you have a compatible dgl-cuda version installed, for example: dgl-cu101 or dgl-cu111, so e.g.pip install dgl-cu111.While comnventional '.cif' and '.pdb' files can be read using jarvis-tools, for complex files you might have to installcif2cellandpytrajrespectively i.e.pip install cif2cell==2.0.0a3andconda install -c ambermd pytraj.Make sure you usebatch_sizeas 32 or 64 for large datasets, and not 2 as given in the example config file, else it will take much longer to train, and performnce might drop a lot.Note thattrain_folder.pyandpretrained.pyin alignn folder are actually python executable scripts. So, even if you don't provide absolute path of these scripts, they should work.Learn about the issue with QM9 results here:https://github.com/usnistgov/alignn/issues/54Make sure you havepandasversion as 1.2.3.ReferencesAtomistic Line Graph Neural Network for improved materials property predictionsPrediction of the Electron Density of States for Crystalline Compounds with Atomistic Line Graph Neural Networks (ALIGNN)Recent advances and applications of deep learning methods in materials scienceDesigning High-Tc Superconductors with BCS-inspired Screening, Density Functional Theory and Deep-learningA Deep-learning Model for Fast Prediction of Vacancy Formation in Diverse MaterialsGraph neural network predictions of metal organic framework CO2 adsorption propertiesRapid Prediction of Phonon Structure and Properties using an Atomistic Line Graph Neural Network (ALIGNN)Unified graph neural network force-field for the periodic tableLarge Scale Benchmark of Materials Design MethodsPlease see detailed publications listhere.How to contributeFor detailed instructions, please seeContribution instructionsCorrespondencePlease report bugs as Github issues (https://github.com/usnistgov/alignn/issues) or email [email protected] supportNIST-MGI (https://www.nist.gov/mgi).Code of conductPlease seeCode of conduct
alignparse
alignparseis a Python package written bythe Bloom lab. It is designed to align long sequencing reads (such as those from PacBio circular consensus sequencing) to targets, filter these alignments based on user-provided specifications, and parse out user-defined sequence features. For each read that passes the filters, information about the features (e.g. accuracy, sequence, mutations) is retained for further analyses.See thealignparse documentationfor details on how to install and usealignparse.Pleasecite alignparseif you use it in your work.The source code ison GitHub.To contribute to this package, read the instructions inCONTRIBUTING.rst.To report issues or seek support, please use theGitHub issue tracker.
align-phonemes
# Phoneme Forced AlignerThis package was designed to intake human data from Makin Lab (.txt and .wav file from the block needed phoneme alignment) and ouput a JSON file with the mike-on and mike-off times and the alignments (start time, transcription method, production 1, phoneme list 1, production 2, phoneme list 2).## Getting StartedThese instructions will give you a copy of the project up and running onyour local machine for development and testing purposes.### InstallingThis is a pip installable package. Therefore, run the following command:____________________________________________________## Functions### get_forced_aligment()input: block txt path, block wav path, output transcription json path, transcription method, critical error threshold, verbosefunctionality:- determine which transcript will be used based on transcription method input (Critical Error, Wav2Vec, Original)- run Montreal Forced aligner (input trials directory and verbose and returns text grid)- demarcate JSON- clean directories____________________________________________________### demarcate_to_json()input: trial directory, block path, text grid directory, output json file pathfunctionality:- read textgrid- use ER-demarcation Algorithm to denote phoneme split- use ER-demarcation to denote transcript split- write to Phoneme Json (see output format)____________________________________________________### clean_directories()input: list of temp directories createdfunctionality: clean and remove directory____________________________________________________### parse_block()input: wav file path, txt file path, trials directory, verbosefunctionality:- create a Trial Directory (same name as the label): each trial is a .wav and a .txt- Trial Directory:Trials dir:trial.wavtrial.txt...Trial transcription method .jsonTranscriptionMethod.json format:{trial start-time (float): method ('wav2vec' or 'original'),...}____________________________________________________## NotesFor a more in depth explanation in the methods used in this package, as well as the reasoning behind, refer back to the paper.## Authors- **James Willian Stonebridge**- **Herbert Alexander de Bruyn**- **Tyler Dierckman**## LicenseThis project is licensed under the MIT License.## Acknowledgments- Varun implemented the original code for Wav2Vec2 based transcription used in this package.
alignreg
AlignRegAlignment Regularization with Data AugmentationImplementation of the AlignReg package associated with the following paper:Haohan Wang, Zeyi Huang, Xindi Wu, and Eric P. Xing. 2022.Toward Learning Robust and Invariant Representations with Alignment Regular- ization and Data Augmentation. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’22), August 14–18, 2022, Washington, DC, USA. ACM, New York, NY, USA,The package is organized by Hanru YanInstallationOne can direclty install the package withpip install alignregOr one can download the code and use it locally.Usage TutorialOne can use the package in simply one line of code.Please visit theiPython examplefor usage instructions in both TensorFlow and PyTorch.Replication:This repository serves for the purpose to guide others to use our tool, if you are interested in the scripts to replicate our results in paper, please contact us and we will share the repository for replication.ContactHaohan Wang·Hanru Yan
aligntext
Text Align - Python Text AlignmentDocumentationPyPISourcesIssuesInstallationInstalling it is pretty easy:pipinstallaligntext
alignunformeval
AlignUnformEvalThis is a python tool to evaluate alignment and uniformity of sentence embedding likeSimCSE paper.SimCSE paperexplains alignment and uniformity as below:Given a distribution of positive pairs p_pos, alignment calculates expected distance between embeddings of the paired instances (assuming representations are already normalized):On the other hand, uniformity measures how well the embeddings are uniformly distributed:> where p_data denotes the data distribution.Installby pippip install alignuniformevalby sourcepip install https://github.com/akiFQC/AlignUnformEvalUsageYou can easily evaluate alignment and uniformity with this library.This is a minimal example that evaluate alignment and uniformity of STS Benchmark.from alignunformeval import STSBEval evaluator = STSBEval(sentence_encoder) # sentence_encoder is a callable from List[str] to numpy.array. The output numpy.array must be [dimention_of_sentence_vector]. result = evaluator.eval_summary() # result = {"alignment": value_of_aligenment, "uniformity": value_of_uniformity}STSBEvalget callable whose input islistofstrand output is n dimentionalnumpy.array.DatasetSTS BenchmarkThis dataset (especially,sts-dev.csv) was used inSimCSE paper. In the paper, the threshold of similarity score was st at 4.0; pairs of sentences whose similarity score is higher than 4.0 are used for evaluation of alignment. You can set other threshold as the following example.from alignunformeval import STSBEval # sentence_encoder : some function List[str] to np.array[dimention_of_sentence_vector] evaluator = STSBEval(sentence_encoder, threshold=3.0) # set threshold at 3.0 result = evaluator.eval_summary()Please seetest/test_stsb.pyif you want more details.Tokyo Metropolitan University Paraphrase Corpus (TMUP)Tokyo Metropolitan University Paraphrase Corpus (TMUP)is a Japanese paraphrase dataset.from alignunformeval import TMUPEval # sentence_encoder : some function List[str] to np.array[dimention_of_sentence_vector] evaluator = TMUPEval(sentence_encoder) result = evaluator.eval_summary()LicenseThe license of this tool follows each dataset. Please read the documents of datasets you use.Referencehttps://arxiv.org/pdf/2104.08821.pdfhttps://ixa2.si.ehu.eus/stswiki/index.php/STSbenchmarkhttps://github.com/tmu-nlp/paraphrase-corpus
aligo
aligo🚀🔥 简单、易用、可扩展的阿里云盘API 接口库 👍👍wiki 文档+examples文档写得很简单,详情请查看 代码提示 + 文档注释有任何疑问 请issue或 加入aligo交流反馈群(群二维码在底部)附带一份文档阿里云盘开放平台文档安装pipinstall-Ualigo pipinstallgit+https://github.com/foyoux/aligo.git快速入门"""快速入门"""fromaligoimportAligoif__name__=='__main__':ali=Aligo()# 第一次使用,会弹出二维码,供扫描登录user=ali.get_user()# 获取用户信息print(user.user_name,user.nick_name,user.phone)# 打印用户信息file_list=ali.get_file_list()# 获取网盘根目录文件列表forfileinfile_list:# 遍历文件列表# 注意:print(file) 默认只显示部分信息,但是实际上file有很多的属性print(file.file_id,file.name,file.type)# 打印文件信息https://user-images.githubusercontent.com/35125624/150529002-c2f1b80b-fb11-4e0a-9fd7-6f57f678ccf5.mp4基本功能完全的代码提示持久化登录、多帐户登录福利码兑换文件夹同步在线解压缩支持功能扩展搜索文件/标签获取重复文件列表文件(夹)重命名文件(夹)上传下载文件(夹)移动复制文件(夹)删除恢复获取文档在线预览接口文件(夹)分享 保存 收藏文件(夹)自定义分享(无限制)获取帐户、云盘(容量)等基本信息相册 创建 删除 修改 添加文件 获取文件Notes:由于秒传链接的失效,自定分享信息的有效期只有4个小时。阿里云盘不同于其他网盘或系统,其定位文件不是基于文件名(路径),而是通过file_id,这才是唯一定位文件的方式,aligo中提供了简便函数get_file_by_path/get_folder_by_path,通过网盘路径获取文件对象,通过 其上的file_id属性即可获取所需文件标识。但不建议频繁使用此方法,因为内部是通过get_file_list遍历得到的。在保存超大分享时(分享中的文件特别多),执行保存全部的方法 -share_file_save_all_to_drive,它会立刻执行完毕,但是文件不会立刻被保存到网盘中,阿里云盘服务器会帮你在后台陆续将所有文件存到你的网盘中;所有当你使用share_file_save_all_to_drive保存超大分享时,却只看到一部分文件时,不用疑惑,这是正常情况。登录网页扫码登录fromaligoimportAligo# 提供 port 参数即可, 之后打开浏览器访问 http://<YOUR_IP>:<port>ali=Aligo(port=8080)发送登录二维码到邮箱(推荐)最佳实践:建议将邮箱绑定到微信,这样能实时收到提醒,登录过期后也可以第一时间收到登录请求。fromaligoimportAligo,EMailConfigif__name__=='__main__':email_config=EMailConfig(email='<接收登录邮件的邮箱地址>',# 自配邮箱user='',password='',host='',port=0,)ali=Aligo(email=email_config)如何操作资源盘fromaligoimportAligoif__name__=='__main__':ali=Aligo()drives=ali.list_my_drives()# resource_drive_id = [drive.drive_id for drive in drives if drive.drive_name == 'resource'][0]v2_user=ali.v2_user_get()resource_drive_id=v2_user.resource_drive_id# 如果后续默认操作资源盘# ali.default_drive_id = resource_drive_idfile_list=ali.get_file_list(drive_id=resource_drive_id)forfileinfile_list:print(file)如何自定义配置文件路径fromaligoimportset_config_folder,Aligoif__name__=='__main__':# 创建 Aligo 对象前,先设置配置文件目录,默认是 <用户目录>/.aligoset_config_folder('/home/aligo')# 会创建 /home/aligo/一号服务器.json 配置文件ali=Aligo(name='一号服务器')关于扩展功能一般步骤:1. 使用浏览器或其他抓包工具,观察通信过程; 2. 获取 url/path + 请求体; 3. 继承 `Aligo`, 使用现有的方法 `self._post` 等,进行发送请求;会自动维护token, 你只需关注如何发送请求即可扩展功能举栗🌰 - 配有视频和代码如何彻底删除文件?无需先移动文件到回收站此功能太危险,aligo未直接提供。不过这里扩展了该功能,请小心使用!声明此项目仅供学习交流,若有不妥之处,侵联必删。❤️‍🔥欢迎加入🤝🏼😃 添加时,请附上留言消息 “aligo” 😜本来是群二维码,但是加进来发广告的太多了,所以改成了个人二维码。
aligo-rest-client
Python 사용자를 위한AligoREST API 모듈입니다.공식 client가 아닌 관계로 이용 중 발생한 문제에 대해 책임지지 않습니다.설치pipinstallaligo-rest-client기능SMS 발송LMS 발송MMS 발송상세전송 결과 확인발송가능 건수 확인일부 에러코드 Exception 랩핑사용법초기화fromaligo.clientimportAligoclient=Aligo(auth_key={발급받은API키},user_id={사용자계정},is_test={테스트모드여부True|False})발송client.sms_send(sender='01012341234',receiver='01012341234',msg='테스트 메시지')client.lms_send(sender='01012341234',receiver='01012341234',msg='테스트 메시지',title='테스트 타이틀')client.mms_send(sender='01012341234',receiver='01012341234',msg='테스트 메시지',title='테스트 타이틀',image={이미지데이터})상세전송 결과 확인client.status(msg_id={발송후전달받은메시지아이디})발송가능 건수 확인client.remain()개발환경 및 테스트 설정pip install requests할 일전송내역조회테스트문서화
alijazini
No description available on PyPI.
alike
No description available on PyPI.
aliker-distributions
No description available on PyPI.
ali-kms-sdk
English | [简体中文](README-CN.md)![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)## AlibabaCloud Encryption SDK for Python[Overview](https://www.alibabacloud.com/help/doc-detail/189340.htm)[Quick Start](https://www.alibabacloud.com/help/doc-detail/201599.html)[Sample Code](/examples/README.md)## Install`shell git clonehttps://github.com/aliyun/alibabacloud-encryption-sdk-python.gitcdalibabacloud-encryption-sdk-pythonpython setup.py install `## License[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
alimata
AlimataWhat is it?Alimata is a python library used to simplify the implementation offirmetixlibraryRequirementspython 3.7 or higherFirmetixFimetix4ArduinoInstallingFirmetixTo install Fimetix on Linux (including Raspberry Pi) and macOS computers, open a terminal window and type:sudo pip3 install firmetixFor Windows users type:pip install firmetixFirmetix arduino librarieOpen the Arduino IDE and select Tools/Manage LibrariesSearch for "Firmetix"InstallFirmetix also requires other library just install all of them.Open the Firmetix/Firmetix4Arduino exampleIf you plan to use multiple arduino use#define ARDUINO_INSTANCE_ID 1Flash it to the arduinoCode structureBoardCreating a new boardboard = Board()Making the setup and loop function and starting the boarddefsetup():#Code here is run oncepassdefloop():#Code here is run in a looppass#Starting the board by passing the setup and loop functionboard.start(setup,loop)#Shuting the board downboard.shutdown()All options of the board#Create the new board (optional board_id and COM_port)board=Board(board_id,COM_port)#Starting the board setup and loop async functionboard.start(setup,loop)#Use to set the pin mode with the type (INPUT, OUTPUT, ANALOG, PWM, SONAR)board.set_pin_mode(pin,type,callback,differential,echo_pin,timeout,sensor_type,min_pulse,max_pulse)#Use to write to a pin with the type (ANALOG, PWM, DIGITAL, TONE, TONE_CONTINUOUS, TONE_STOP, SERVO, STEPPER)board.write_pin(pin,value,type,duration,step)SensorsCreating a new sensor object (button in this case)button1 = Button(board, 2)ActuatorsCreating a new actuator object (led in this case)led1 = Led(board, 3)
alime
Alime: Animated anti-bot email obfuscation for your websiteStops email scraping bots that don't understand CSS transforms and page layoutWorks without JavaScript (JavaScript is only used to make a clickable mailto: link)Demo pageUsageInstall the tool from PyPI:python3-mpipinstallalimeRun alime with your email:python3-malime'[email protected]'alime-example.html, alime.css, and alime.js are created in the current directory.Copy alime.css and alime.js (optional for mailto: hyperlink support) to your website.Copy the marked contents of alime-example.html into your webpage HTML source.More options are available by using alime from Python code:importalimehelp(alime.Alime)gen=alime.Alime('[email protected]')gen.generated_html,gen.generated_css,gen.generated_jsgen.save()
alimits
alimitsProvides asyncio-compatible implementations of thelimitslibrarystorage and strategy options. Used in theslowapilibrary.Documentation is availablehere.Available on PyPi atalimits.StrategiesThis library implements a couple asyncio limiting strategies:Fixed window → (alimits.strategies.AsyncFixedWindowRateLimiter)Moving window → (alimits.strategies.AsyncMovingWindowRateLimiter)Fixed window with elastic expiration → (alimits.strategies.AsyncFixedWindowElasticRateLimiter)Resourceshttps://limits.readthedocs.io/en/stable/strategies.htmlhttps://medium.com/figma-design/an-alternative-approach-to-rate-limiting-f8a06cf7c94chttps://cloud.google.com/architecture/rate-limiting-strategies-techniquesStorage BackendsEach of the above rate limiters support a couple different storage backends:Memory (in-memory, volatile) → (alimits.storage.AsyncMemoryStorage)Redis (on-disk or in-memory, persistent) → (alimits.storage.AsyncRedisStorage)Other storage backends are a WIP.LicenseCopyright (c) 2021 Elias Gabriel, 2020 Laurent Savaete, 2015 Ali-Akber SaifeeThis software is licensed under theMIT License.This package isTreeware. If you use it in production, then we ask that youbuy the world a treeto thank us for our work. By contributing to the forest you’ll be creating employment for local families and restoring wildlife habitats.
ali-mqtt
Ali MQTTMQTT auth info generator for Ali IoT
alimsg
No description available on PyPI.
alina-api
No description available on PyPI.
alina-first-package
My first projectThis is my first project - Alina
alinester1
Failed to fetch description. HTTP Status Code: 404
alink
alinkBring users directly to specific content in your Android app.Installation$ pip3 install alinkUsage$ alink https://m.taobao.com
ali-opensearch
[![Build Status](https://travis-ci.org/yanheven/ali-opensearch-sdk.svg?branch=master)](https://travis-ci.org/yanheven/ali-opensearch-sdk)[![Coverage Status](https://coveralls.io/repos/yanheven/ali-opensearch-sdk/badge.svg?branch=master&service=github)](https://coveralls.io/github/yanheven/ali-opensearch-sdk?branch=master)[![PyPI version](https://badge.fury.io/py/ali-opensearch.svg)](https://badge.fury.io/py/ali-opensearch)### Aliyun OpenSearch Python SDKali-opensearch-sdk is a python SDK for [Aliyun OpenSearch](http://www.aliyun.com/product/opensearch) Product.Based on OpenSearch API version v2. This SDK supports both python2.x and python3.x.Pypi link:[https://pypi.python.org/pypi/ucloudclient](https://pypi.python.org/pypi/ali-opensearch/2.0.0)Project manage [Launchpad](https://launchpad.net/ali-opensearch-python-sdk)#### 1 Design##### 1.1 SDK structureThere are 7 type of resources provided by opensearch, they are:1, app: Application2, data: Data Process3, search: Search Related Action4, suggest: Suggestion for Search5, index: Index Reconstruction6, quota: Quota Management7, log: Error Log QueryThere are 5 Operation for almost all resources, they are CURD as follow:1, list: list all of this type of resources.2, show: show detail information of a specific resource.3,4,5, CUD: create, update and delete a specific resource.###### 1.1.1 app Operation:#### 2, Installation:You can install via pip:#pip install ali-opensearchOr, From Source code:#git clone https://git.oschina.net/yanhyphen/ali-opensearch-sdk.git#cd ali-opensearch-sdk#python setup.py install#### 3, Getting Started :from opensearchsdk.client import Client as osclientclient = osclient(base_url, key, key_id)apps = client.app.list()print appsoutput:{u'status': u'OK',u'total': u'1',u'result': [{u'description': u'test',u'created': u'1447753400',u'id': u'119631',u'name': u'test'}],u'request_id': u'1447866418002866600607068'}More examples can be found in `opensearchsdk/demo.py`.Note: All return data from server were remained.#### 4, Contribute and BUG:This project was managed via [Launchpad](https://launchpad.net/ali-opensearch-python-sdk).Welcome to log bugs and commit patch.Code style follow the PEP8 rules.#### 5, License:Apache License Version 2.0#### 6, Release Note:1, V2.0.0-dev Provide only few functions of opensearch, not yet cover all functions.2, V2.0.0 completed all api functions.3, V2.0.1 add compatibility for python3.5.
aliopts
No description available on PyPI.
alioss
osscmd lets you create/delete/list bucket and upload/download/copy/delete file from/toAliyun OSS (Open Storage Service).The package would not be update .===============================OSSCMS使用方法如READMD,安装方法如下:==================================easy_install alioss用法和ali的说明文档一致,但是可直接调用OSSCMD,方法类似于django-admin.pywindows下直接运行osscmd.py原文README如下===============================阿里云开放存储服务 Open Storage Service (OSS) Python SDK说明文档===============================================================阿里云开放存储服务官方网站:http://oss.aliyun.com阿里云开放存储===============================================================存储在OSS里的文件叫做"object". 所有的object都放在bucket里面。简介===============================================================这篇文档主要介绍如何使用Python来进行OSS API调用,并且介绍osscmd的简单使用。这篇文档假设你已经熟悉Python,熟悉OSS的相关概念,并且已经注册了阿里云的OSS服务,且获得了相应的ID和KEY。如果你还没有开通或者还不了解OSS,请移步OSS官方网站。环境要求===============================================================Python SDK需要:安装python 2.5(包括)以上且在3.0(不包括)以下的版本。可以在Windows平台和Linux平台使用。如何获取===============================================================1. 打开浏览器,输入oss.aliyun.com2. 找到Python SDK链接:3. 下载后可以得到类似OSS_Python_API_xxxxxxxx.tar.gz的包4. 进入压缩包所在的目录,进行解压缩5. 解压缩后得到,oss文件夹和osscmd文件使用说明===============================================================使用oss_api.py===============================================================1. 创建bucketdef put_bucket(self, bucket, acl='', headers=None):等同create_bucket函数def create_bucket(self, bucket, acl='', headers=None):参数说明:bucket,类型:stringacl,类型:string,目前为private,public-read,public-read-write中的一种headers, 类型:dict,默认为空返回值说明:HTTP Response参见http://docs.python.org/2/library/httplib.htmldef put_bucket_with_location(self, bucket, acl='', location='', headers=None):参数说明:bucket,类型:stringacl,类型:stringlocation, 类型:stringheaders, 类型:dict返回值说明:HTTP Response2. 删除bucketdef delete_bucket(self, bucket, headers=None):参数说明:bucket,类型:stringheaders, 类型:dict返回值说明:HTTP Response3. 修改bucket访问权限def put_bucket(self, bucket, acl='', headers=None):def create_bucket(self, bucket, acl='', headers=None):同1中的put_bucket和create_bucket4. 获取bucket访问权限def get_bucket_acl(self, bucket):参数说明:bucket,类型:string返回值说明:HTTP Response5. 显示创建的bucketdef get_service(self, headers=None):参数说明:headers, 类型:dict返回值说明:HTTP Responsedef list_all_my_buckets(self, headers=None):参数说明:headers, 类型:dict返回值说明:HTTP Response6. 上传objectdef put_object_from_string(self, bucket, object, input_content, content_type=DefaultContentType, headers=None, params=None):参数说明:bucket,类型:stringobject,类型:stringinput_content,类型:stringcontent_type,类型:stringheaders,类型:dictparams,类型:dict返回值说明:HTTP Responsedef put_object_from_file(self, bucket, object, filename, content_type='', headers=None, params=None):参数说明:bucket,类型:stringobject,类型:stringfilename,类型:string,本地需要上传的文件名content_type,类型:string,object的类型headers,类型:dictparams,类型:dict返回值说明:HTTP Response7. 显示上传的objectdef get_bucket(self, bucket, prefix='', marker='', delimiter='', maxkeys='', headers=None):同list_bucketdef list_bucket(self, bucket, prefix='', marker='', delimiter='', maxkeys='', headers=None):参数说明:bucket,类型:stringprefix,类型:stringmarker,类型:stringdelimiter,类型:stringmaxkeys,类型:stringheaders,类型:dict返回值说明:HTTP Response8. 删除objectdef delete_object(self, bucket, object, headers=None):参数说明:bucket,类型:stringobject,类型:stringheaders,类型:dict返回值说明:HTTP Response9. 下载objectdef get_object_to_file(self, bucket, object, filename, headers=None):参数说明:bucket,类型:stringobject,类型:stringfilename,类型:string,将object内容下载到本地文件的文件名headers,类型:dict返回值说明:HTTP Response10. 使用示例:在解压的oss目录下,创建一个测试文件test.py内容如下,并将ACCESS_ID和SECRET_ACCESS_KEY的内容填写正确,并且将BUCKET填写一个唯一的名字。#!/usr/bin/env python#coding=utf8import timefrom oss_api import *from oss_xml_handler import *HOST="oss.aliyuncs.com"ACCESS_ID = ""SECRET_ACCESS_KEY = ""#ACCESS_ID and SECRET_ACCESS_KEY 默认是空,#请填入您申请的正确的ID和KEY.BUCKET = ""#bucket 默认是空,请填入唯一的bucket名称#例如test-bucket-20130101等带唯一日期的bucket名字.def check_not_empty(input, msg=""):if not input:print "Please make sure %s not empty!" % msgexit(-1)def check_res(res, msg=""):if res.status / 100 == 2:print "%s OK" % msgelse:print "%s FAIL" % msgprint "ret:%s" % res.statusprint "request-id:%s" % res.getheader("x-oss-request-id")print "reason:%s" % res.read()exit(-1)if __name__ == "__main__":#初始化check_not_empty(ACCESS_ID, "ACCESS_ID")check_not_empty(SECRET_ACCESS_KEY, "SECRET_ACCESS_KEY")oss = OssAPI(HOST, ACCESS_ID, SECRET_ACCESS_KEY)#创建属于自己的bucketbucket = BUCKETcheck_not_empty(bucket, "bucket")acl = 'private'headers = {}res = oss.put_bucket(bucket, acl, headers)check_res(res, "create bucket")#列出创建的bucketres = oss.get_service()check_res(res, "list all buckets")#把指定的字符串内容上传到bucket中,在bucket中的文件名叫object。object = "object_test"input_content = "hello, OSS"content_type = "text/HTML"headers = {}res = oss.put_object_from_string(bucket, object, input_content, content_type, headers)check_res(res, "upload from string")#指定文件名, 把这个文件上传到bucket中,在bucket中的文件名叫object。object = "object_test"filename = __file__content_type = "text/HTML"headers = {}res = oss.put_object_from_file(bucket, object, filename, content_type, headers)check_res(res, "upload from localfile")#下载bucket中的object,内容在body中object = "object_test"headers = {}res = oss.get_object(bucket, object, headers)check_res(res, "download object")#下载bucket中的object,把内容写入到本地文件中object = "object_test"headers = {}filename = "get_object_test_file"res = oss.get_object_to_file(bucket, object, filename, headers)if os.path.isfile(filename):os.remove(filename)check_res(res, "download object to localfile")#查看bucket中所拥有的权限res = oss.get_bucket_acl(bucket)check_res(res, "get bucket acl")#列出bucket中所拥有的objectprefix = ""marker = ""delimiter = "/"maxkeys = "100"headers = {}res = oss.get_bucket(bucket, prefix, marker, delimiter, maxkeys, headers)check_res(res, "list objects in bucket")#删除bucket中的objectobject = "object_test"headers = {}res = oss.delete_object(bucket, object, headers)check_res(res, "delete object")#删除bucketres = oss.delete_bucket(bucket)check_res(res, "delete bucket")11. 示例的预期结果:create bucket OKlist all buckets OKupload from string OKupload from localfile OKdownload object OKdownload object to localfile OKget bucket acl OKlist objects in bucket OKdelete object OKdelete bucket OK使用osscmd===============================================================1. 在Linux上安装 osscmd.sudo rm -r /usr/local/osssudo mkdir -p /usr/local/osssudo tar -zxf oss.tar.gz -C /usr/local/osssudo rm -f /usr/bin/osscmdsudo ln -s /usr/local/oss/osscmd /usr/bin/osscmdsudo chmod 755 /usr/local/oss/osscmd在Windows上安装osscmd解压缩包2. 运行"python osscmd config --id=YOUR_ID --key=YOUR_KEY"用来配置访问OSS所需要的认证码3. 运行"python osscmd getallbucket" 列出创建的bucket.如果是刚刚使用OSS的用户因为没有创建bucket,输出是空4. 运行"python osscmd createbucket mybucket" 创建一个名字叫mybucket的bucket,有可能不成功,这个时候需要换一个名字。因为OSS中的bucket名字是全局唯一的。5. 可以再次运行"python osscmd getallbucket" 查看是否创建成功。如果没有成功请检查osscmd返回的错误信息。6. 成功创建bucket后。运行"python osscmd list oss://mybucket/",查看bucket中有哪些object。由于bucket中还没有object,输出是空的。7. 向bucket中上传一个object.$ md5sum my_local_file7625e1adc3a4b129763d580ca0a78e44 my_local_file$ python osscmd put my_local_file oss://mybucket/myobject8. 如果创建成功,再次运行"python osscmd list oss://mybucket/"9. 从bucket中下载object到本地文件,并比对下载的文件的md5值$ python osscmd get oss://mybucket/myobject local_file$ md5sum local_file7625e1adc3a4b129763d580ca0a78e44 local_file10. 删除bucket中的object$ python osscmd delete oss://mybucket/myobject11. 删除bucket, 注意,如果bucket中有object或者parts则这个bucket不能被删除$ python osscmd deletebucket test-oss-aliyun-comChangeHistory===============================================================0.3.2 - 2013-10-20* 修复osscmd的uploadfromdir命令中,在中文目录下,上传的object名字被截断的问题。* 修复oss_util.py中DEBUG被设置成True的情况下无法打印log的问题。* oss_api.py中增加了设置每次上传和下载大小的接口。* osscmd增加了--debug=true来打印日志。* oss_api.py中增加了上传失败时候的重试,最大重试100次。0.3.1 - 2013-08-02* 支持跳转。* 给oss_api.py部分函数增加说明。0.1.3 - 2013-07-12* 支持multipart相关操作,osscmd增加multipart相关的接口。osscmd支持本地目录上传。osscmd支持将bucket的某一个prefix的object下载到本地的目录。0.1.0 - 2011-11-15* 第一次操作支持基本的创建,删除和显示bucket。支持创建,删除和显示object。
alioth
No description available on PyPI.
aliot-py
ALIOT-PY: The python implementation of the Aliot library!What is Aliot?Before everything else, aliot is a fancy websocket written in python that aims to facilitate iot focused exchanges between a server and a clientInstallationcreate a python virtual environmentrun the commandpy -m venv venvadd aliot in a folder in your project (replace $FOLDER in the command by the name of your folder)run the commandpip install ./$FOLDERCreating my first Aliot programcreate an object ObjConnecteCreating an endpoint (or, like we call it here, a protocol)Create a function that takes some parameters# my function will take money ($) and give cookies for every 2$ receiveddefgive_cookies_for_money(money:int):return{"cookies":money//2}Register your function as a protocol by decorating it with theon_recvdecorator in your ObjConnecte that you created for your project and pass the id of your protocol in the argument of the decorator# here, I chose that my function will be protocol 34@my_iot.on_recv(action_id=34)defgive_cookies_for_money(money:int):return{"cookies":money//2}As of now, my functiongive_cookies_for_moneydoesn't return anything to the server, if I want to send back my cookies, I have to ways:use the functionmy_iot.send()@my_iot.on_recv(action_id=34)defgive_cookies_for_money(money:int):my_iot.send({"cookies":money//2})set the convenience parametersend_resultto True in the decorator@my_iot.on_recv(action_id=34,send_result=True)defgive_cookies_for_money(money:int):return{"cookies":money//2}You're all set! Now repeat and enjoy! 🎉Order of execution (oncerun()is called)obj.on_start()On receive:[ interceptor.intercept_recv() ]decoder.decode_event(event: dict) -> AliotEventcontroller.handle_event(event: AliotEvent) -> Nonedecoder.decode_data(data: dict) -> TOn send:encoder.encode_data(data: Any) -> dictencode.encode_event()obj.__send_event() -> None
alipai
PAI Python SDKEnglish |简体中文The PAI Python SDK is provided by Alibaba Cloud'sPlatform for Artificial Intelligence (PAI). It offers a user-friendly High-Level API, enabling machine learning engineers to easily train and deploy models on PAI using Python, streamlining the machine learning workflow.Installation 🔧Install the PAI Python SDK using the following command, which supports Python versions >= 3.6 (it is recommended to use Python >= 3.8):python-mpipinstallalipai📖 DocumentationFind detailed documentation, including API references and user guides, in thedocsdirectory or visitPAI Python SDK Documentation.🛠 Basic UsageSubmit a custom training jobThe following example demonstrates how to submit a custom training job to PAI:frompai.estimatorimportEstimatorfrompai.imageimportretrieveest=Estimator(# Retrieve the latest PyTorch image provided by PAIimage_uri=retrieve(framework_name="PyTorch",framework_version="latest").image_uri,command="echo hello",# Optionally, specify the source_dir to upload your training code:# source_dir="./train_src",instance_type="ecs.c6.large",)# Submit the training jobest.fit()print(est.model_data())Deploy Large Language ModelPAI provides numerous pretrained models that you can easily deploy using the PAI Python SDK:frompai.modelimportRegisteredModel# Retrieve the QWen-7b model provided by PAIqwen_model=RegisteredModel("qwen-7b-chat-lora",model_provider="pai")# Deploy the modelp=qwen_model.deploy(service_name="qwen_service")# Call the servicep.predict(data={"prompt":"How to install PyTorch?","system_prompt":"Act like you are programmer with 5+ years of experience.","temperature":0.8,})For more details, please refer to thePAI Python SDK Documentation.🤝 ContributingContributions to the PAI Python SDK are welcome. Please read our contribution guidelines in theCONTRIBUTINGfile.📝 LicensePAI Python SDK is developed by Alibaba Cloud and licensed under the Apache License (Version 2.0).📬 ContactFor support or inquiries, please open an issue on the GitHub repository or contact us in the DingTalk group:
alipan
No description available on PyPI.
alipay
An Unofficial Alipay API for Python=======================================.. image:: https://img.shields.io/travis/lxneng/alipay.svg:target: https://travis-ci.org/lxneng/alipay.. image:: https://img.shields.io/pypi/v/alipay.svg:target: https://pypi.python.org/pypi/alipay/.. image:: https://img.shields.io/pypi/dm/alipay.svg:target: https://pypi.python.org/pypi/alipay/Overview---------------------------------------An Unofficial Alipay API for Python, It Contain these API:- Generate direct payment url- Generate partner trade payment url- Generate standard mixed payment url- Generate batch trans pay url- Generate send goods confirm url- Generate forex trade url- Generate QR code url- Verify notify- Single Trade Queryofficial document: https://b.alipay.com/order/techService.htmInstall---------------------------------------.. code-block:: bashpip install alipayUsage---------------------------------------Initialization~~~~~~~~~~~~~~~~~~~~~~~.. code-block:: python>>> from alipay import Alipay>>> alipay = Alipay(pid='your_alipay_pid', key='your_alipay_key', seller_email='your_seller_mail')Or you can use `seller_id` instead of `seller_email`:.. code-block:: python>>> alipay = Alipay(pid='your_alipay_pid', key='your_alipay_key', seller_id='your_seller_id')Generate direct payment url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成即时到账支付链接Introduction: https://b.alipay.com/order/productDetail.htm?productId=2012111200373124.. code-block:: python>>> alipay.create_direct_pay_by_user_url(out_trade_no='your_order_id', subject='your_order_subject', total_fee='100.0', return_url='your_order_return_url', notify_url='your_order_notify_url')'https://mapi.alipay.com/gateway.do?seller_email=.....'Generate partner trade payment url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成担保交易支付链接Introduction: https://b.alipay.com/order/productDetail.htm?productId=2012111200373121.. code-block:: python>>> params = {... 'out_trade_no': 'your_order_id',... 'subject': 'your_order_subject',... 'logistics_type': 'DIRECT',... 'logistics_fee': '0',... 'logistics_payment': 'SELLER_PAY',... 'price': '10.00',... 'quantity': '12',... 'return_url': 'your_order_return_url',... 'notify_url': 'your_order_notify_url'... }>>> alipay.create_partner_trade_by_buyer_url(**params)'https://mapi.alipay.com/gateway.do?seller_email=.....'Generate standard mixed payment url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成标准双接口支付链接Introduction: https://b.alipay.com/order/productDetail.htm?productId=2012111300373136.. code-block:: python>>> alipay.trade_create_by_buyer_url(**params)'https://mapi.alipay.com/gateway.do?seller_email=.....'Generate batch trans pay url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成批量付款链接Introduction: https://b.alipay.com/order/productDetail.htm?productId=2012111200373121.. code-block:: python>>> params = {... 'batch_list': (), #批量付款用户列表... 'account_name': 'seller_account_name', #卖家支付宝名称... 'batch_no': 'batch_id', #转账流水号,须唯一... 'notify_url': 'your_batch_notify_url' #异步通知地址... }>>> alipay.create_batch_trans_notify_url(**params)'https://mapi.alipay.com/gateway.do?seller_email=xxx&detail_data=....'Note: batch_list 为批量付款用户列表,具体格式如下例子:(如涉及中文请使用unicode字符).. code-block:: python>>> batch_list = ({'account': '[email protected]', #支付宝账号... 'name': u'测试', #支付宝用户姓名... 'fee': '100', #转账金额... 'note': 'test'},... {'account': '[email protected]', #支付宝账号... 'name': u'测试', #支付宝用户姓名... 'fee': '100', #转账金额... 'note': 'test'}) #转账原因Generate send goods confirm url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成确认发货链接Introduction: https://cshall.alipay.com/support/help_detail.htm?help_id=491097.. code-block:: python>>> params = {... 'trade_no': 'your_alipay_trade_id',... 'logistics_name': 'your_logicstic_name',... 'transport_type': 'EXPRESS',... 'invocie_no': 'your_invocie_no'... }>>> alipay.send_goods_confirm_by_platform(**params)'https://mapi.alipay.com/gateway.do?sign=.....&trade_no=...'Generate forex trade url~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..- Create website payment for foreigners (With QR code)- Create mobile payment for foreignersIntroduction: http://global.alipay.com/ospay/home.htm.. code-block:: python>>> params = {... 'out_trade_no': 'your_order_id',... 'subject': 'your_order_subject',... 'logistics_type': 'DIRECT',... 'logistics_fee': '0',... 'logistics_payment': 'SELLER_PAY',... 'price': '10.00',... 'quantity': '12',... 'return_url': 'your_order_return_url',... 'notify_url': 'your_order_notify_url'... }>>> # Create website payment for foreigners>>> alipay.create_forex_trade_url(**params)'https://mapi.alipay.com/gateway.do?service=create_forex_trade......'>>> # Create mobile payment for foreigners>>> alipay.create_forex_trade_wap_url(**params)'https://mapi.alipay.com/gateway.do?service=create_forex_trade_wap......'Generate QR code url~~~~~~~~~~~~~~~~~~~..生成创建 QR 码链接Introduction: https://b.alipay.com/order/productDetail.htm?productId=2012120700377303.. code-block:: python>>> alipay.add_alipay_qrcode_url(**params)'https://mapi.alipay.com/gateway.do?seller_id=.......'Note: 如果你的 `biz_data` 中有 Unicode 字符,在 dumps 的时候需要把 `ensure_ascii` 设置为 `False`,即 :code:`json.dumps(d, ensure_ascii=False)` 否则会遇到错误Verify notify~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~verify notify from alipay server, example in Pyramid Application.. code-block:: pythondef alipy_notify(request):alipay = request.registry['alipay']if alipay.verify_notify(**request.params):# this is a valid notify, code business logic hereelse:# this is a invalid notifySingle Trade Query~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..单笔交易查询文档:http://wenku.baidu.com/link?url=WLjyz-H6AlfDLIU7kR4LcVNQgxSTMxX61fW0tDCE8yZbqXflCd0CVFsZaIKbRFDvVLaFlq0Q3wcJ935A7Kw-mRSs0iA4wQu8cLaCe5B8FIq.. code-block:: pythonimport rexml = alipay.single_trade_query(out_trade_no="10000005")res = re.findall('<trade_status>(\S+)</trade_status>', xml) # use RE to find trade_status, xml parsing is more useful, in fact.status = None if not res else res[0]print status # will print out TRADE_SUCCESS when trade is successGenerate Refund With Pwd URL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..生成即时到账有密退款链接Introduction: https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.XRddqH&treeId=62&articleId=104744&docType=1.. code-block:: python>>> params = {... 'batch_list': (), #批量退款数据集... 'batch_no': 'batch_id', #退款批次号,须唯一... 'notify_url': 'your_batch_notify_url' #异步通知地址... }>>> alipay.refund_fastpay_by_platform_pwd(**params)'https://mapi.alipay.com/gateway.do?seller_email=xxx&detail_data=....'Note: batch_list 为批量退款数据集,具体格式如下例子:(如涉及中文请使用unicode字符).. code-block:: python>>> batch_list = ({'trade_no': 'xxxxxxxx', #原付款支付宝交易号... 'fee': '100', #退款总金额... 'note': 'test'}, #退款原因... {'trade_no': 'xxxxxxxx', #原付款支付宝交易号... 'fee': '100', #退款总金额... 'note': 'test'}) #退款原因Example in Pyramid Application~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Include alipay either by setting your includes in your .ini, or by calling config.include('alipay')... code-block:: pythonpyramid.includes = alipaynow in your View.. code-block:: pythondef some_view(request):alipay = request.registry['alipay']url = alipay.create_direct_pay_by_user_url(...)Reference---------------------------------------- `Ruby Alipay GEM <https://github.com/chloerei/alipay>`_- `Official document <https://b.alipay.com/order/techService.htm>`_Changelog==============================0.7.4 - Feb.28, 2017--------------------------------- add `refund_fastpay_by_platform_pwd` methodhttps://github.com/lxneng/alipay/pull/260.7.3 - Dec.14, 2015--------------------------------- replace open() calls with io.open() for Python 3 compatibility,fix `UnicodeDecodeError`- add `create_direct_pay_by_user_url` doc for Wap site0.7.2 - Nov.1, 2015--------------------------------- add `single_trade_query` methodhttps://github.com/lxneng/alipay/pull/200.7.1 - Sep.16, 2015--------------------------------- Fix verify_notify raise KeyError: 'sign' bughttps://github.com/lxneng/alipay/pull/180.7 - Sep.07, 2015--------------------------------- add `create_forex_trade_url` method- add `create_forex_trade_wap_url` method- add `create_batch_trans_notify_url` method0.6 - Jul.27, 2015--------------------------------- add `send_goods_confirm_by_platform` method0.5 - Apr.16, 2015--------------------------------- add `add_alipay_qrcode` method0.4.2 - Feb.14, 2015--------------------------------- Fix argument type error of verify_notify in README- FIX SEVERE FAULT IN `check_notify_remotely`0.4.1 - Feb.09, 2015--------------------------------- Resolved README.rst is not formatted on pypi.python.org0.4 - Feb.09, 2015--------------------------------- Seller id support0.3 - Aug.03, 2014--------------------------------- Add wap payment support0.2.3 - Nov.20, 2013--------------------------------- english version readme doc0.2.2 - Nov.12, 2013--------------------------------- add includeme func for pyramid- update readme0.2.1 - Nov.11, 2013--------------------------------- fix rst doc0.2 - Nov.11, 2013--------------------------------- add unittest- update readme- add verify_notify func- add check_parameters func- add travis.yml- add tox.ini0.1 - Nov.11, 2013------------------------------- first commit
alipaycloud-baasdt
English | [简体中文](README-CN.md) ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)## Alipay Cloud BAASDT SDK for Python## InstallationInstall with pipPython SDK uses a common package management tool namedpip. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/“pip User Guide”) to install pip.`bash # Install thealipaycloud_sdk_baasdt-testpip installalipaycloud_sdk_baasdt-test`## Issues[Opening an Issue](https://github.com/aliyun/alibabacloud-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.## ChangelogDetailed changes for each release are documented in the [release notes](./ChangeLog.md).## References[Latest Release](https://github.com/aliyun/alibabacloud-sdk/tree/master/python)## License[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
alipaycloud-ebc
English | [简体中文](README-CN.md) ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)## Alipay Cloud EBC SDK for Python## InstallationInstall with pipPython SDK uses a common package management tool namedpip. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/“pip User Guide”) to install pip.`bash # Install thealipaycloud_sdk_ebc-testpip installalipaycloud_sdk_ebc-test`## Issues[Opening an Issue](https://github.com/aliyun/alibabacloud-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.## ChangelogDetailed changes for each release are documented in the [release notes](./ChangeLog.md).## References[Latest Release](https://github.com/aliyun/alibabacloud-sdk/tree/master/python)## License[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
alipayfanhua
No description available on PyPI.
alipay-python
The official Alipay SDK for Python.访问蚂蚁金服开放平台的官方SDK。LinksWebsite:https://open.alipay.comExample#!/usr/bin/env python# -*- coding: utf-8 -*-importloggingimporttracebackfromalipay.aop.api.AlipayClientConfigimportAlipayClientConfigfromalipay.aop.api.DefaultAlipayClientimportDefaultAlipayClientfromalipay.aop.api.FileItemimportFileItemfromalipay.aop.api.domain.AlipayTradeAppPayModelimportAlipayTradeAppPayModelfromalipay.aop.api.domain.AlipayTradePagePayModelimportAlipayTradePagePayModelfromalipay.aop.api.domain.AlipayTradePayModelimportAlipayTradePayModelfromalipay.aop.api.domain.GoodsDetailimportGoodsDetailfromalipay.aop.api.domain.SettleDetailInfoimportSettleDetailInfofromalipay.aop.api.domain.SettleInfoimportSettleInfofromalipay.aop.api.domain.SubMerchantimportSubMerchantfromalipay.aop.api.request.AlipayOfflineMaterialImageUploadRequestimportAlipayOfflineMaterialImageUploadRequestfromalipay.aop.api.request.AlipayTradeAppPayRequestimportAlipayTradeAppPayRequestfromalipay.aop.api.request.AlipayTradePagePayRequestimportAlipayTradePagePayRequestfromalipay.aop.api.request.AlipayTradePayRequestimportAlipayTradePayRequestfromalipay.aop.api.response.AlipayOfflineMaterialImageUploadResponseimportAlipayOfflineMaterialImageUploadResponsefromalipay.aop.api.response.AlipayTradePayResponseimportAlipayTradePayResponselogging.basicConfig(level=logging.INFO,format='%(asctime)s%(levelname)s%(message)s',filemode='a',)logger=logging.getLogger('')if__name__=='__main__':""" 设置配置,包括支付宝网关地址、app_id、应用私钥、支付宝公钥等,其他配置值可以查看AlipayClientConfig的定义。 """alipay_client_config=AlipayClientConfig()alipay_client_config.server_url='https://openapi.alipay.com/gateway.do'alipay_client_config.app_id='[your app_id]'alipay_client_config.app_private_key='[your app private key]'alipay_client_config.alipay_public_key='[alipay public key]'""" 得到客户端对象。 注意,一个alipay_client_config对象对应一个DefaultAlipayClient,定义DefaultAlipayClient对象后,alipay_client_config不得修改,如果想使用不同的配置,请定义不同的DefaultAlipayClient。 logger参数用于打印日志,不传则不打印,建议传递。 """client=DefaultAlipayClient(alipay_client_config=alipay_client_config,logger=logger)""" 系统接口示例:alipay.trade.pay """# 对照接口文档,构造请求对象model=AlipayTradePayModel()model.auth_code="282877775259787048"model.body="Iphone6 16G"goods_list=list()goods1=GoodsDetail()goods1.goods_id="apple-01"goods1.goods_name="ipad"goods1.price=10goods1.quantity=1goods_list.append(goods1)model.goods_detail=goods_listmodel.operator_id="yx_001"model.out_trade_no="20180510AB014"model.product_code="FACE_TO_FACE_PAYMENT"model.scene="bar_code"model.store_id=""model.subject="huabeitest"model.timeout_express="90m"model.total_amount=1request=AlipayTradePayRequest(biz_model=model)# 如果有auth_token、app_auth_token等其他公共参数,放在udf_params中# udf_params = dict()# from alipay.aop.api.constant.ParamConstants import *# udf_params[P_APP_AUTH_TOKEN] = "xxxxxxx"# request.udf_params = udf_params# 执行请求,执行过程中如果发生异常,会抛出,请打印异常栈response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayTradePayResponse()# 解析响应结果response.parse_response_content(response_content)print(response.body)ifresponse.is_success():# 如果业务成功,则通过respnse属性获取需要的值print("get response trade_no:"+response.trade_no)else:# 如果业务失败,则从错误码中可以得知错误情况,具体错误码信息可以查看接口文档print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 带文件的系统接口示例:alipay.offline.material.image.upload """# 如果没有找到对应Model类,则直接使用Request类,属性在Request类中request=AlipayOfflineMaterialImageUploadRequest()request.image_name="我的店"request.image_type="jpg"# 设置文件参数f=open("/Users/foo/Downloads/IMG.jpg","rb")request.image_content=FileItem(file_name="IMG.jpg",file_content=f.read())f.close()response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayOfflineMaterialImageUploadResponse()response.parse_response_content(response_content)ifresponse.is_success():print("get response image_url:"+response.image_url)else:print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 页面接口示例:alipay.trade.page.pay """# 对照接口文档,构造请求对象model=AlipayTradePagePayModel()model.out_trade_no="pay201805020000226"model.total_amount=50model.subject="测试"model.body="支付宝测试"model.product_code="FAST_INSTANT_TRADE_PAY"settle_detail_info=SettleDetailInfo()settle_detail_info.amount=50settle_detail_info.trans_in_type="userId"settle_detail_info.trans_in="2088302300165604"settle_detail_infos=list()settle_detail_infos.append(settle_detail_info)settle_info=SettleInfo()settle_info.settle_detail_infos=settle_detail_infosmodel.settle_info=settle_infosub_merchant=SubMerchant()sub_merchant.merchant_id="2088301300153242"model.sub_merchant=sub_merchantrequest=AlipayTradePagePayRequest(biz_model=model)# 得到构造的请求,如果http_method是GET,则是一个带完成请求参数的url,如果http_method是POST,则是一段HTML表单片段response=client.page_execute(request,http_method="GET")print("alipay.trade.page.pay response:"+response)""" 构造唤起支付宝客户端支付时传递的请求串示例:alipay.trade.app.pay """model=AlipayTradeAppPayModel()model.timeout_express="90m"model.total_amount="9.00"model.seller_id="2088301194649043"model.product_code="QUICK_MSECURITY_PAY"model.body="Iphone6 16G"model.subject="iphone"model.out_trade_no="201800000001201"request=AlipayTradeAppPayRequest(biz_model=model)response=client.sdk_execute(request)print("alipay.trade.app.pay response:"+response)
alipay-sdk
支付宝 Python SDK支付宝第三方 Python SDKrequirementspython >= 3.6
alipay-sdk-python
The official Alipay SDK for Python.访问蚂蚁金服开放平台的官方SDK。LinksWebsite:https://open.alipay.comIssues不管您在使用SDK的过程中遇到任何问题,欢迎前往支付宝开放社区发帖与支付宝工作人员和其他开发者一起交流。注:为了提高开发者问题的响应时效,github本身的issue功能已关闭,支付宝开放社区中发帖的问题,通常会在2小时内响应。Example#!/usr/bin/env python# -*- coding: utf-8 -*-importloggingimporttracebackfromalipay.aop.api.AlipayClientConfigimportAlipayClientConfigfromalipay.aop.api.DefaultAlipayClientimportDefaultAlipayClientfromalipay.aop.api.FileItemimportFileItemfromalipay.aop.api.domain.AlipayTradeAppPayModelimportAlipayTradeAppPayModelfromalipay.aop.api.domain.AlipayTradePagePayModelimportAlipayTradePagePayModelfromalipay.aop.api.domain.AlipayTradePayModelimportAlipayTradePayModelfromalipay.aop.api.domain.GoodsDetailimportGoodsDetailfromalipay.aop.api.domain.SettleDetailInfoimportSettleDetailInfofromalipay.aop.api.domain.SettleInfoimportSettleInfofromalipay.aop.api.domain.SubMerchantimportSubMerchantfromalipay.aop.api.request.AlipayOfflineMaterialImageUploadRequestimportAlipayOfflineMaterialImageUploadRequestfromalipay.aop.api.request.AlipayTradeAppPayRequestimportAlipayTradeAppPayRequestfromalipay.aop.api.request.AlipayTradePagePayRequestimportAlipayTradePagePayRequestfromalipay.aop.api.request.AlipayTradePayRequestimportAlipayTradePayRequestfromalipay.aop.api.response.AlipayOfflineMaterialImageUploadResponseimportAlipayOfflineMaterialImageUploadResponsefromalipay.aop.api.response.AlipayTradePayResponseimportAlipayTradePayResponselogging.basicConfig(level=logging.INFO,format='%(asctime)s%(levelname)s%(message)s',filemode='a',)logger=logging.getLogger('')if__name__=='__main__':""" 设置配置,包括支付宝网关地址、app_id、应用私钥、支付宝公钥等,其他配置值可以查看AlipayClientConfig的定义。 """alipay_client_config=AlipayClientConfig()alipay_client_config.server_url='https://openapi.alipay.com/gateway.do'alipay_client_config.app_id='[your app_id]'alipay_client_config.app_private_key='[your app private key]'alipay_client_config.alipay_public_key='[alipay public key]'""" 得到客户端对象。 注意,一个alipay_client_config对象对应一个DefaultAlipayClient,定义DefaultAlipayClient对象后,alipay_client_config不得修改,如果想使用不同的配置,请定义不同的DefaultAlipayClient。 logger参数用于打印日志,不传则不打印,建议传递。 """client=DefaultAlipayClient(alipay_client_config=alipay_client_config,logger=logger)""" 系统接口示例:alipay.trade.pay """# 对照接口文档,构造请求对象model=AlipayTradePayModel()model.auth_code="282877775259787048"model.body="Iphone6 16G"goods_list=list()goods1=GoodsDetail()goods1.goods_id="apple-01"goods1.goods_name="ipad"goods1.price=10goods1.quantity=1goods_list.append(goods1)model.goods_detail=goods_listmodel.operator_id="yx_001"model.out_trade_no="20180510AB014"model.product_code="FACE_TO_FACE_PAYMENT"model.scene="bar_code"model.store_id=""model.subject="huabeitest"model.timeout_express="90m"model.total_amount=1request=AlipayTradePayRequest(biz_model=model)# 如果有auth_token、app_auth_token等其他公共参数,放在udf_params中# udf_params = dict()# from alipay.aop.api.constant.ParamConstants import *# udf_params[P_APP_AUTH_TOKEN] = "xxxxxxx"# request.udf_params = udf_params# 执行请求,执行过程中如果发生异常,会抛出,请打印异常栈response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayTradePayResponse()# 解析响应结果response.parse_response_content(response_content)print(response.body)ifresponse.is_success():# 如果业务成功,则通过respnse属性获取需要的值print("get response trade_no:"+response.trade_no)else:# 如果业务失败,则从错误码中可以得知错误情况,具体错误码信息可以查看接口文档print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 带文件的系统接口示例:alipay.offline.material.image.upload """# 如果没有找到对应Model类,则直接使用Request类,属性在Request类中request=AlipayOfflineMaterialImageUploadRequest()request.image_name="我的店"request.image_type="jpg"# 设置文件参数f=open("/Users/foo/Downloads/IMG.jpg","rb")request.image_content=FileItem(file_name="IMG.jpg",file_content=f.read())f.close()response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayOfflineMaterialImageUploadResponse()response.parse_response_content(response_content)ifresponse.is_success():print("get response image_url:"+response.image_url)else:print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 页面接口示例:alipay.trade.page.pay """# 对照接口文档,构造请求对象model=AlipayTradePagePayModel()model.out_trade_no="pay201805020000226"model.total_amount=50model.subject="测试"model.body="支付宝测试"model.product_code="FAST_INSTANT_TRADE_PAY"settle_detail_info=SettleDetailInfo()settle_detail_info.amount=50settle_detail_info.trans_in_type="userId"settle_detail_info.trans_in="2088302300165604"settle_detail_infos=list()settle_detail_infos.append(settle_detail_info)settle_info=SettleInfo()settle_info.settle_detail_infos=settle_detail_infosmodel.settle_info=settle_infosub_merchant=SubMerchant()sub_merchant.merchant_id="2088301300153242"model.sub_merchant=sub_merchantrequest=AlipayTradePagePayRequest(biz_model=model)# 得到构造的请求,如果http_method是GET,则是一个带完成请求参数的url,如果http_method是POST,则是一段HTML表单片段response=client.page_execute(request,http_method="GET")print("alipay.trade.page.pay response:"+response)""" 构造唤起支付宝客户端支付时传递的请求串示例:alipay.trade.app.pay """model=AlipayTradeAppPayModel()model.timeout_express="90m"model.total_amount="9.00"model.seller_id="2088301194649043"model.product_code="QUICK_MSECURITY_PAY"model.body="Iphone6 16G"model.subject="iphone"model.out_trade_no="201800000001201"request=AlipayTradeAppPayRequest(biz_model=model)response=client.sdk_execute(request)print("alipay.trade.app.pay response:"+response)
alipay-sdk-python-pycryptodome
The official Alipay SDK for Python.访问蚂蚁金服开放平台的官方SDK。LinksWebsite:https://open.alipay.comExample#!/usr/bin/env python# -*- coding: utf-8 -*-importloggingimporttracebackfromalipay.aop.api.AlipayClientConfigimportAlipayClientConfigfromalipay.aop.api.DefaultAlipayClientimportDefaultAlipayClientfromalipay.aop.api.FileItemimportFileItemfromalipay.aop.api.domain.AlipayTradeAppPayModelimportAlipayTradeAppPayModelfromalipay.aop.api.domain.AlipayTradePagePayModelimportAlipayTradePagePayModelfromalipay.aop.api.domain.AlipayTradePayModelimportAlipayTradePayModelfromalipay.aop.api.domain.GoodsDetailimportGoodsDetailfromalipay.aop.api.domain.SettleDetailInfoimportSettleDetailInfofromalipay.aop.api.domain.SettleInfoimportSettleInfofromalipay.aop.api.domain.SubMerchantimportSubMerchantfromalipay.aop.api.request.AlipayOfflineMaterialImageUploadRequestimportAlipayOfflineMaterialImageUploadRequestfromalipay.aop.api.request.AlipayTradeAppPayRequestimportAlipayTradeAppPayRequestfromalipay.aop.api.request.AlipayTradePagePayRequestimportAlipayTradePagePayRequestfromalipay.aop.api.request.AlipayTradePayRequestimportAlipayTradePayRequestfromalipay.aop.api.response.AlipayOfflineMaterialImageUploadResponseimportAlipayOfflineMaterialImageUploadResponsefromalipay.aop.api.response.AlipayTradePayResponseimportAlipayTradePayResponselogging.basicConfig(level=logging.INFO,format='%(asctime)s%(levelname)s%(message)s',filemode='a',)logger=logging.getLogger('')if__name__=='__main__':""" 设置配置,包括支付宝网关地址、app_id、应用私钥、支付宝公钥等,其他配置值可以查看AlipayClientConfig的定义。 """alipay_client_config=AlipayClientConfig()alipay_client_config.server_url='https://openapi.alipay.com/gateway.do'alipay_client_config.app_id='[your app_id]'alipay_client_config.app_private_key='[your app private key]'alipay_client_config.alipay_public_key='[alipay public key]'""" 得到客户端对象。 注意,一个alipay_client_config对象对应一个DefaultAlipayClient,定义DefaultAlipayClient对象后,alipay_client_config不得修改,如果想使用不同的配置,请定义不同的DefaultAlipayClient。 logger参数用于打印日志,不传则不打印,建议传递。 """client=DefaultAlipayClient(alipay_client_config=alipay_client_config,logger=logger)""" 系统接口示例:alipay.trade.pay """# 对照接口文档,构造请求对象model=AlipayTradePayModel()model.auth_code="282877775259787048"model.body="Iphone6 16G"goods_list=list()goods1=GoodsDetail()goods1.goods_id="apple-01"goods1.goods_name="ipad"goods1.price=10goods1.quantity=1goods_list.append(goods1)model.goods_detail=goods_listmodel.operator_id="yx_001"model.out_trade_no="20180510AB014"model.product_code="FACE_TO_FACE_PAYMENT"model.scene="bar_code"model.store_id=""model.subject="huabeitest"model.timeout_express="90m"model.total_amount=1request=AlipayTradePayRequest(biz_model=model)# 如果有auth_token、app_auth_token等其他公共参数,放在udf_params中# udf_params = dict()# from alipay.aop.api.constant.ParamConstants import *# udf_params[P_APP_AUTH_TOKEN] = "xxxxxxx"# request.udf_params = udf_params# 执行请求,执行过程中如果发生异常,会抛出,请打印异常栈response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayTradePayResponse()# 解析响应结果response.parse_response_content(response_content)print(response.body)ifresponse.is_success():# 如果业务成功,则通过respnse属性获取需要的值print("get response trade_no:"+response.trade_no)else:# 如果业务失败,则从错误码中可以得知错误情况,具体错误码信息可以查看接口文档print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 带文件的系统接口示例:alipay.offline.material.image.upload """# 如果没有找到对应Model类,则直接使用Request类,属性在Request类中request=AlipayOfflineMaterialImageUploadRequest()request.image_name="我的店"request.image_type="jpg"# 设置文件参数f=open("/Users/foo/Downloads/IMG.jpg","rb")request.image_content=FileItem(file_name="IMG.jpg",file_content=f.read())f.close()response_content=Nonetry:response_content=client.execute(request)exceptExceptionase:print(traceback.format_exc())ifnotresponse_content:print("failed execute")else:response=AlipayOfflineMaterialImageUploadResponse()response.parse_response_content(response_content)ifresponse.is_success():print("get response image_url:"+response.image_url)else:print(response.code+","+response.msg+","+response.sub_code+","+response.sub_msg)""" 页面接口示例:alipay.trade.page.pay """# 对照接口文档,构造请求对象model=AlipayTradePagePayModel()model.out_trade_no="pay201805020000226"model.total_amount=50model.subject="测试"model.body="支付宝测试"model.product_code="FAST_INSTANT_TRADE_PAY"settle_detail_info=SettleDetailInfo()settle_detail_info.amount=50settle_detail_info.trans_in_type="userId"settle_detail_info.trans_in="2088302300165604"settle_detail_infos=list()settle_detail_infos.append(settle_detail_info)settle_info=SettleInfo()settle_info.settle_detail_infos=settle_detail_infosmodel.settle_info=settle_infosub_merchant=SubMerchant()sub_merchant.merchant_id="2088301300153242"model.sub_merchant=sub_merchantrequest=AlipayTradePagePayRequest(biz_model=model)# 得到构造的请求,如果http_method是GET,则是一个带完成请求参数的url,如果http_method是POST,则是一段HTML表单片段response=client.page_execute(request,http_method="GET")print("alipay.trade.page.pay response:"+response)""" 构造唤起支付宝客户端支付时传递的请求串示例:alipay.trade.app.pay """model=AlipayTradeAppPayModel()model.timeout_express="90m"model.total_amount="9.00"model.seller_id="2088301194649043"model.product_code="QUICK_MSECURITY_PAY"model.body="Iphone6 16G"model.subject="iphone"model.out_trade_no="201800000001201"request=AlipayTradeAppPayRequest(biz_model=model)response=client.sdk_execute(request)print("alipay.trade.app.pay response:"+response)
alipdf
This is the homepage of our project.
aliprojectlib
my first
alipy
ALiPy: Active Learning in PythonAuthors: Ying-Peng Tang, Guo-Xiang Li,Sheng-Jun HuangOnline document:http://parnec.nuaa.edu.cn/huangsj/alipy/IntroductionALiPy是一个基于Python实现的主动学习工具包,内置20余种主动学习算法,并提供包括数据处理、结果可视化等工具。ALiPy根据主动学习框架的不同部件提供了若干独立的工具类,这样一方面可以方便地支持不同主动学习场景,另一方面可以使用户自由地组织自己的项目,用户可以不必继承任何接口来实现自己的算法与替换项目中的部件。此外,ALiPy不仅支持多种不同的主动学习场景,如标注代价敏感,噪声标注者,多标记查询等。详细的介绍与文档请参考工具包的官方网站。ALiPy provides a module based implementation of active learning framework, which allows users to conveniently evaluate, compare and analyze the performance of active learning methods. It implementations more than 20 algorithms and also supports users to easily implement their own approaches under different settings.Features of alipy include:Model independentThere is no limitation to the classification model. One can use SVM in sklearn or deep model in tensorflow as you need.Module independentOne can freely modify one or more modules of the toolbox without affection to the others.Implement your own algorithm without inheriting anythingThere are few limitations of the user-defined functions, such as the parameters or names.Variant Settings supportedNoisy oracles, Multi-label, Cost effective, Feature querying, etc.Powerful toolsSave intermediate results of each iteration AND recover the program from any breakpoints.Parallel the k-folds experiment.Gathering, process and visualize the experiment results.Provide 25 algorithms.Support 7 different settings.For more detailed introduction and tutorial, please refer to thewebsite of alipy.SetupYou can get alipy simply by:pip install alipyOr clone alipy source code to your local directory and build from source:cd ALiPy python setup.py installThe dependencies of alipy are:Python dependencypython >= 3.4Basic Dependenciesnumpy scipy scikit-learn matplotlib prettytableOptional dependenciescvxpyNote that, the basic dependencies must be installed, and the optional dependencies are required only if users need to involke KDD'13 BMDR and AAAI'19 SPAL methods in alipy. (cvxpy will not be installed throughpip install alipy.)Tools in alipyThe tool classes provided by alipy cover as many components in active learning as possible. It aims to support experiment implementation with miscellaneous tool functions. These tools are designed in a low coupling way in order to let users to program the experiment project at their own customs.Usingalipy.data_manipulateto preprocess and split your data sets for experiments.Usingalipy.query_strategyto invoke traditional and state-of-the-art methods.Usingalipy.index.IndexCollectionto manage your labeled indexes and unlabeled indexes.Usingalipy.metricto calculate your model performances.Usingalipy.experiment.stateandalipy.experiment.state_ioto save the intermediate results after each query and recover the program from the breakpoints.Usingalipy.experiment.stopping_criteriato get some example stopping criteria.Usingalipy.experiment.experiment_analyserto gathering, process and visualize your experiment results.Usingalipy.oracleto implement clean, noisy, cost-sensitive oracles.Usingalipy.utils.multi_threadto parallel your k-fold experiment.The implemented query strategiesALiPy provide several commonly used strategies for now, and new algorithms will continue to be added in subsequent updates.AL with Instance Selection: Uncertainty (SIGIR 1994), Graph Density (CVPR 2012), QUIRE (TPAMI 2014), SPAL (AAAI 2019), Query By Committee (ICML 1998), Random, BMDR (KDD 2013), LAL (NIPS 2017), Expected Error Reduction (ICML 2001)AL for Multi-Label Data: AUDI (ICDM 2013) , QUIRE (TPAMI 2014) , Random, MMC (KDD 2009), Adaptive (IJCAI 2013)AL by Querying Features: AFASMC (KDD 2018) , Stability (ICDM 2013) , RandomAL with Different Costs: HALC (IJCAI 2018) , Random , Cost performanceAL with Noisy Oracles: CEAL (IJCAI 2017) , IEthresh (KDD 2009) , All, RandomAL with Novel Query Types: AURO (IJCAI 2015)AL for Large Scale Tasks: SubsamplingImplement your own algorithmIn alipy, there is no limitation for your implementation. All you need is ensure the returned selected index is a subset of unlabeled indexes.select_ind = my_query(unlab_ind, **my_parameters) assert set(select_ind) < set(unlab_ind)UsageThere are 2 ways to use alipy. For a high-level encapsulation, you can use alipy.experiment.AlExperiment class. Note that, AlExperiment only support the most commonly used scenario - query all labels of an instance. You can run the experiments with only a few lines of codes by this class. All you need is to specify the various options, the query process will be run in multi-threaded. Note that, if you want to implement your own algorithm with this class, there are some constraints have to be satisfied, please see api reference for this class.from sklearn.datasets import load_iris from alipy.experiment.al_experiment import AlExperiment X, y = load_iris(return_X_y=True) al = AlExperiment(X, y, stopping_criteria='num_of_queries', stopping_value=50,) al.split_AL() al.set_query_strategy(strategy="QueryInstanceUncertainty", measure='least_confident') al.set_performance_metric('accuracy_score') al.start_query(multi_thread=True) al.plot_learning_curve()To customize your own active learning experiment, it is recommended to follow the examples provided in the ALiPy/examples and tutorial inalipy main page, pick the tools according to your usage. In this way, on one hand, the logic of your program is absolutely clear to you and thus easy to debug. On the other hand, some parts in your active learning process can be substituted by your own implementation for special usage.import copy from sklearn.datasets import load_iris from alipy import ToolBox X, y = load_iris(return_X_y=True) alibox = ToolBox(X=X, y=y, query_type='AllLabels', saving_path='.') # Split data alibox.split_AL(test_ratio=0.3, initial_label_rate=0.1, split_count=10) # Use the default Logistic Regression classifier model = alibox.get_default_model() # The cost budget is 50 times querying stopping_criterion = alibox.get_stopping_criterion('num_of_queries', 50) # Use pre-defined strategy QBCStrategy = alibox.get_query_strategy(strategy_name='QueryInstanceQBC') QBC_result = [] for round in range(10): # Get the data split of one fold experiment train_idx, test_idx, label_ind, unlab_ind = alibox.get_split(round) # Get intermediate results saver for one fold experiment saver = alibox.get_stateio(round) while not stopping_criterion.is_stop(): # Select a subset of Uind according to the query strategy # Passing model=None to use the default model for evaluating the committees' disagreement select_ind = QBCStrategy.select(label_ind, unlab_ind, model=None, batch_size=1) label_ind.update(select_ind) unlab_ind.difference_update(select_ind) # Update model and calc performance according to the model you are using model.fit(X=X[label_ind.index, :], y=y[label_ind.index]) pred = model.predict(X[test_idx, :]) accuracy = alibox.calc_performance_metric(y_true=y[test_idx], y_pred=pred, performance_metric='accuracy_score') # Save intermediate results to file st = alibox.State(select_index=select_ind, performance=accuracy) saver.add_state(st) saver.save() # Passing the current progress to stopping criterion object stopping_criterion.update_information(saver) # Reset the progress in stopping criterion object stopping_criterion.reset() QBC_result.append(copy.deepcopy(saver)) analyser = alibox.get_experiment_analyser(x_axis='num_of_queries') analyser.add_method(method_name='QBC', method_results=QBC_result) print(analyser) analyser.plot_learning_curves(title='Example of AL', std_area=True)CitationPlease cite our work:Tang, Y.-P.; Li, G.-X.; and Huang, S.-J. 2019. ALiPy: Active learning in python. Technical report, Nanjing University of Aeronautics and Astronautics. available as arXiv preprint https://arxiv.org/abs/1901.03802.@techreport{TLHalipy, author = {Ying-Peng Tang and Guo-Xiang Li and Sheng-Jun Huang}, title = {{ALiPy}: Active Learning in Python}, institution = {Nanjing University of Aeronautics and Astronautics}, url = {https://github.com/NUAA-AL/ALiPy}, note = {available as arXiv preprint \url{https://arxiv.org/abs/1901.03802}}, month = jan, year = 2019 }
aliqat
aliqat
aliquoter
Aliquoter=========Aliquot mogrifier utilizing the BLM PLSS method of quartering/halving sections.Purpose-------Given a quad of point pairs (long, lat) return a quad of point pairs for aspecific aliquot string.This code should work on any quad in any orientation as long as north, south,east, west can be defined appropriately.This code uses specific points rather than a bounding box set to 0 degrees.Example-------Aliquot string: **E2SW4SW4**Aliquot meaning: **The East half of the South West quarter of the South West quarter**This would mean that the quad would be split up into a South West square (SW4)and then another South West square (SW4) and then the East half of that squarewould be returned.<pre>4,0 4,4+-----------------------+-----------------------+| | || | || | || | || | || | || | || | || | || S-W | || \ / | |+-----------+-----------+-----------------------+| | | || | | || | | || S-W | | || \ / | | |+-----*******-----------+-----------------------+| * * | || * * | || * E * | || * * | || * * | |+-----*******-----------+-----------------------+0,0 0,4</pre>Usage-----Check out 'test.py'. It represents the above example and outputs the following.Code:```pythonfrom aliquoter import aliquot, Quad, Pointprint aliquot(Quad(nw=Point(lat=4, long=0),sw=Point(lat=0, long=0),ne=Point(lat=4, long=4),se=Point(lat=0, long=4),),['SW', 'SW', 'E'])```In the above code the list of aliquot quarters/halves is reversed to makeprocessing more straight forward.Result:```Quad(nw=Point(lat=1.0, long=0.5),sw=Point(lat=0.0, long=0.5),ne=Point(lat=1.0, long=1.0),se=Point(lat=0.0, long=1.0))```
alireza
This extensive toolkit is specifically designed to enhance productivity and streamline the development process when working with Python frameworks. With a wide range of powerful and time-saving tools at your disposal, it empowers developers to tackle complex challenges efficiently and effectively.From scaffolding projects to automating repetitive tasks, this toolkit offers an array of features that simplify common development workflows. It provides seamless integration with popular Python frameworks, offering an extensive collection of utilities, libraries, and modules tailored to enhance the capabilities of your chosen framework. Unlock the potential of this comprehensive toolkit and enjoy benefits such as code generation, and much more. Whether you are working on web development, data science, or any other domain, this toolkit serves as a valuable companion throughout the entire development lifecycle. Accelerate your Python framework projects, reduce development time, and increase code quality with this indispensable toolkit that caters to the diverse needs of developers, allowing them to focus on delivering exceptional results.
alirezalmpackage
Failed to fetch description. HTTP Status Code: 404
aliro-aqn
aliro-aqnThis is an api for the Aliro Q.NetworkThis Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.0.0Package version: 1.0.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python 2.7 and 3.4+Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallaliro-aqnThen import the package:importaliro_aqnGetting StartedImport necessary modulesimportaliro_aqnfromaliro_aqn.restimportApiExceptionfrompprintimportpprintfromtypingimportListSet up authenticationYou can retrieve your API token in your "Account" page athttps://aqn.aliro.io/configuration=aliro_aqn.Configuration()configuration.api_key['Authorization']='API_TOKEN'configuration.host='https://aqn.aliro.io'Documentation for API EndpointsAll URIs are relative tohttp://localhost:3998/v1ClassMethodHTTP requestDescriptionAuthenticationApiauth_login_postPOST/auth/loginlogin using username and passwordSubmissionsApisubmissions_details_stream_getGET/submissions/details/streamget details about a submission's resultsSubmissionsApisubmissions_postPOST/submissionssubmit a new submissionUserApiuser_api_key_postPOST/user/apiKeygenerate Aliro API key for userUserApiuser_information_update_postPOST/user/informationUpdateupdate user email and nameUserApiuser_password_change_postPOST/user/passwordChangechange user password from known passwordDocumentation For ModelsApiKeyApiKeyResponseBasicSuccessChangePasswordParametersClassicalChannelCredentialsBasicLoginResponseMemoryMemoryBaseMemoryInputMemoryOutputMemoryOutputAllOfNodeQuantumConnectionRequestSubmissionAqnSubmissionAqnBaseSubmissionAqnInputSubmissionAqnOutputSubmissionAqnOutputAllOfUpdateUserInformationParametersUserInfoDocumentation For AuthorizationJwtKeyAuthType: API keyAPI key parameter name: AuthorizationLocation: HTTP [email protected]
aliro-honeywell
aliro-honeywellThis is an api to connect to the Honeywell backendThis Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.0.0Package version: 1.0.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python 2.7 and 3.4+Installation & Usagepip installpipinstallaliro-honeywellThen import the package:importaliro_honeywellGetting StartedPlease follow theinstallation procedureand then run the following:from__future__importprint_functionimporttimeimportaliro_honeywellfromaliro_honeywell.restimportApiExceptionfrompprintimportpprint# Defining the host is optional and defaults to https://qapi.honeywell.com/v1# See configuration.py for a list of all supported configuration parameters.configuration=aliro_honeywell.Configuration(host="https://qapi.honeywell.com/v1")# Enter a context with an instance of the API clientwithaliro_honeywell.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=aliro_honeywell.AuthenticationApi(api_client)login_post_parameters=aliro_honeywell.LoginPostParameters()# LoginPostParameters | (optional)try:# This API returns an id-token and a refresh-token.api_response=api_instance.login_post(login_post_parameters=login_post_parameters)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthenticationApi->login_post:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://qapi.honeywell.com/v1ClassMethodHTTP requestDescriptionAuthenticationApilogin_postPOST/loginThis API returns an id-token and a refresh-token.JobApijob_job_id_cancel_postPOST/job/{job-id}/cancelPreviously submitted quantum job may be canceled using this APIJobApijob_job_id_getGET/job/{job-id}Users monitor job status using job status API. In addition to this API, users may set notification preferences via user portal to allow email or text notifications related to job status. These portal-configured notifications are out of scope for this API specification. Different results formatters may be added in the future via additional query string parameters. Current API specification supports raw results only. To retrieve job status and results, the following API is used:JobApijob_postPOST/jobQuantum job may be submitted using the following APIMachineApimachine_getGET/machineThis API returns a list of available machine names at that time.MachineApimachine_name_getGET/machine/{name}MeteringApimetering_getGET/meteringMetering API is used to retrieve information about the jobs run and the number of QCU consumed within specific period of time. Metering requests can use date range, last X number of days or last Y number of jobs.Documentation For ModelsErrorResponseErrorResponseErrorInlineResponse200InlineResponse2001InlineResponse2002InlineResponse2003InlineResponse2003JobsInlineResponseDefaultInlineResponseDefault1JobPostParametersJobResponseLoginPostParametersDocumentation For AuthorizationJwtKeyAuthType: API keyAPI key parameter name: AuthorizationLocation: HTTP [email protected]
aliro-quantum
aliro-quantumThis is an api for the Aliro Quantum AppThis Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.0.0Package version: 2.33.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python 2.7 and 3.4+Installation & Usagepip installpipinstallaliro-quantumThen import the package:importaliro_quantumGetting StartedPlease follow theinstallation procedureand then run the following:Aliro Quantum PIP Package Getting StartedInstall the Aliro Quantum pip packagepipinstallaliro-quantumImport necessary modulesimportaliro_quantumfromaliro_quantum.restimportApiExceptionfrompprintimportpprintfromtypingimportListSet up authenticationYou can retrieve your API token in your "Account" page athttps://app.aliro.io/configuration=aliro_quantum.Configuration()configuration.api_key['Authorization']='API_TOKEN'configuration.host='https://app.aliro.io'Retrieve possible languagesAt the time of this writing, possible languages are:QASMQuilquil_language:strwithaliro_quantum.ApiClient(configuration)asapi_client:info_api_instance=aliro_quantum.InfoApi(api_client)try:languages_list:aliro_quantum.InfoGetResponse=info_api_instance.info_languages_get(inputs_only=True)quil_language=next(language_info.valueforlanguage_infoinlanguages_list.dataiflanguage_info.id=='quil')pprint(languages_list)exceptApiExceptionase:print("Exception when calling InfoApi->info_languages_get:%s\n"%e)raisee{'data': [{'id': 'qasm', 'value': 'QASM'}, {'id': 'quil', 'value': 'Quil'}]}Retrieve possible execution typesAt the time of this writing, possible execution types are:realsimulatedbothsimulation_only_execution_type:strwithaliro_quantum.ApiClient(configuration)asapi_client:info_api_instance=aliro_quantum.InfoApi(api_client)try:execution_type_info_list:aliro_quantum.InfoGetResponse=info_api_instance.info_execution_types_get()simulation_only_execution_type=next(execution_type_info.valueforexecution_type_infoinexecution_type_info_list.dataifexecution_type_info.id=='2')pprint(execution_type_info_list)exceptApiExceptionase:print("Exception when calling InfoApi->auth_login_post:%s\n"%e)raisee{'data': [{'id': '1', 'value': 'real'}, {'id': '2', 'value': 'simulated'}, {'id': '3', 'value': 'both'}]}Get possible device targets and informationdevices_list:aliro_quantum.OwnerDetailswithaliro_quantum.ApiClient(configuration)asapi_client:device_rankings_api_instance=aliro_quantum.DeviceRankingsApi(api_client)try:devices_list_response:aliro_quantum.DeviceListResponse=device_rankings_api_instance.devices_list_get()devices_list=devices_list_response.datapprint(devices_list_response)exceptApiExceptionase:print("Exception when calling DeviceRankingsApi->devices_list_get:%s\n"%e)raisee{'data': {'owners': {'IBM': {'devices': {'ibmq_rome': {'device_id': 'ibmq_rome', 'display_name': 'ibmq_rome', 'gates': [{'fidelity': 0.9880405409838382, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9994152165869413, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 4, 'pos_x': 200.0, 'pos_y': 0.0, 'real_qubit': 4}, 'qubit_to': {'fidelity_rotation': 0.9993837791241802, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 3, 'pos_x': 150.0, 'pos_y': 0.0, 'real_qubit': 3}}, {'fidelity': 0.9856693955271434, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9993837791241802, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 3, 'pos_x': 150.0, 'pos_y': 0.0, 'real_qubit': 3}, 'qubit_to': {'fidelity_rotation': 0.9994152165869413, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 4, 'pos_x': 200.0, 'pos_y': 0.0, 'real_qubit': 4}}, {'fidelity': 0.9892630599738325, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9993837791241802, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 3, 'pos_x': 150.0, 'pos_y': 0.0, 'real_qubit': 3}, 'qubit_to': {'fidelity_rotation': 0.9993763479004819, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 2, 'pos_x': 100.0, 'pos_y': 0.0, 'real_qubit': 2}}, {'fidelity': 0.9868122191056748, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9993763479004819, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 2, 'pos_x': 100.0, 'pos_y': 0.0, 'real_qubit': 2}, 'qubit_to': {'fidelity_rotation': 0.9993837791241802, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 3, 'pos_x': 150.0, 'pos_y': 0.0, 'real_qubit': 3}}, {'fidelity': 0.9883232732901912, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9993763479004819, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 2, 'pos_x': 100.0, 'pos_y': 0.0, 'real_qubit': 2}, 'qubit_to': {'fidelity_rotation': 0.9995167318229694, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 1, 'pos_x': 50.0, 'pos_y': 0.0, 'real_qubit': 1}}, {'fidelity': 0.9861370891980876, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9995167318229694, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 1, 'pos_x': 50.0, 'pos_y': 0.0, 'real_qubit': 1}, 'qubit_to': {'fidelity_rotation': 0.9993763479004819, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 2, 'pos_x': 100.0, 'pos_y': 0.0, 'real_qubit': 2}}, {'fidelity': 0.9786906667138251, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.9995167318229694, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 1, 'pos_x': 50.0, 'pos_y': 0.0, 'real_qubit': 1}, 'qubit_to': {'fidelity_rotation': 0.999416000095865, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 0, 'pos_x': 0.0, 'pos_y': 0.0, 'real_qubit': 0}}, {'fidelity': 0.9766032827219325, 'gate_type': 'CX', 'qubit_from': {'fidelity_rotation': 0.999416000095865, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 0, 'pos_x': 0.0, 'pos_y': 0.0, 'real_qubit': 0}, 'qubit_to': {'fidelity_rotation': 0.9995167318229694, 'last_reported_fidelity_rotation_datetime': '2020-06-18T09:25:03+00:00', 'name': 1, 'pos_x': 50.0, 'pos_y': 0.0, 'real_qubit': 1}}], 'is_simulator': False, 'last_calibration': '2020-06-18T09:25:03+00:00', 'max_shots': 8192, 'next_available_time': None, 'price': None, 't1': 70.59164221606711, 't2': 92.8079648560683}}}}}}Choose desired target (owner + device ID) from devices_listexample_owner=list(devices_list.owners.keys())[0]exmaple_device_id=list(devices_list.owners[example_owner].devices.keys())[0]example_target=aliro_quantum.OwnerDetails(owners={example_owner:aliro_quantum.OwnerDetailsOwners(devices={exmaple_device_id:aliro_quantum.DeviceDetails()})})pprint(f'Owner:{example_owner}')pprint(f'Device ID:{exmaple_device_id}')'Owner: IBM' 'Device ID: ibmq_rome'Create submission infosubmission_name='test_submission'submission_post_parameters=aliro_quantum.Submission(circuits=[aliro_quantum.Circuit(body='DECLARE ro BIT[1]\nH 0\nMEASURE 0 ro[0]\n',jobs=[aliro_quantum.Job(allocations=aliro_quantum.JobAllocations(input_parameters=aliro_quantum.CompilationParameters(num_allocations=4)),execution=aliro_quantum.JobExecution(parameters=aliro_quantum.ExecutionParameters(num_shots=200,output_type=simulation_only_execution_type)),target=example_target)],language=quil_language)],name=submission_name)Submit the new submissionwithaliro_quantum.ApiClient(configuration)asapi_client:submissions_api_instance=aliro_quantum.SubmissionsApi(api_client)try:submission_api_response=submissions_api_instance.submissions_post(submission_post_parameters=submission_post_parameters)pprint(submission_api_response)exceptApiExceptionase:print("Exception when calling SubmissionsApi->submissions_post:%s\n"%e){'success': True}Wait for completionThis will likely take a few minutes or more.submission_details:aliro_quantum.Submissionwithaliro_quantum.ApiClient(configuration)asapi_client:submissions_api_instance=aliro_quantum.SubmissionsApi(api_client)try:forsubmission_get_responseinsubmissions_api_instance.submissions_submission_name_stream_get(submission_name=submission_name,completion_only='true'):submission_details=submission_get_response.submission_detailbreakexceptApiExceptionase:print("Exception when calling SubmissionsApi->submissions_submission_name_stream_get:%s\n"%e)Print resultsShot-for-shot results will be a list of measurements for each allocation of the circuit.first_circuit:aliro_quantum.Circuit=submission_details.circuits[0]first_job:aliro_quantum.Job=first_circuit.jobs[0]errors:List[aliro_quantum.JobErrors]=first_job.errorsiflen(errors):pprint(errors)else:execution:aliro_quantum.JobExecution=first_job.executionresults:aliro_quantum.ExecutionResults=execution.resultsresults_simulated:aliro_quantum.ResultsData=results.simulatedresults_simulated_measurements:aliro_quantum.ResultsDataMeasurements=results_simulated.measurementspprint(results_simulated_measurements.raw)[[[1], [1], [0], [0], [1], [1], [1], [1], [0], [1], [1], [1], [1], [0], [0], [1], [1], [0], [0], [0], [1], [1], [1], [1], [0], [0], [1], [1], [0], [0], [1], [1], [1], [0], [0], [0], [1], [0], [0], [0], [1], [0], [0], [0], [1], [0], [0], [0], [1], [1]], [[0], [0], [0], [0], [0], [0], [0], [0], [1], [0], [1], [0], [1], [1], [0], [1], [0], [1], [0], [0], [0], [1], [0], [1], [0], [0], [1], [1], [0], [1], [0], [1], [0], [0], [0], [1], [1], [1], [0], [1], [1], [0], [1], [0], [1], [1], [0], [1], [1], [1]], [[1], [0], [1], [0], [0], [1], [1], [1], [1], [1], [0], [0], [1], [1], [1], [1], [0], [0], [1], [0], [0], [0], [0], [0], [0], [1], [1], [1], [1], [0], [1], [0], [0], [1], [1], [1], [1], [0], [1], [1], [1], [1], [0], [1], [1], [1], [1], [0], [0], [1]], [[0], [0], [1], [0], [1], [0], [1], [0], [1], [1], [0], [1], [1], [0], [0], [0], [1], [1], [1], [1], [1], [0], [1], [0], [1], [1], [0], [0], [0], [1], [1], [1], [0], [0], [0], [0], [0], [0], [0], [1], [0], [0], [0], [0], [0], [0], [0], [0], [0], [1]]]Documentation for API EndpointsAll URIs are relative tohttps://app.aliro.ioClassMethodHTTP requestDescriptionAuthenticationApiauth_login_postPOST/auth/loginlogin using username and passwordCircuitApicircuit_qaoa_postPOST/circuit/qaoacompiles a quantum circuit for use in QAOACircuitApicircuit_translation_postPOST/circuit/translationtranslates circuits into other quantum languagesCircuitApicircuit_visualization_getGET/circuit/visualizationCircuitApicircuit_visualization_postPOST/circuit/visualizationconverts a Quil circuit into a PNG imageCredentialsApicredentials_vendor_deleteDELETE/credentials/{vendor}delete vendor credentials for a userCredentialsApicredentials_vendor_putPUT/credentials/{vendor}add vendor credentials for a userDeviceRankingsApidevices_list_getGET/devicesListretrieves list of potential devices to run the circuit onDeviceRankingsApidevices_list_stream_getGET/devicesList/streamstreams device detail updatesDeviceRankingsApidevices_next_available_getGET/devices/nextAvailableretrieves list of next avaiable times for devicesDeviceRankingsApirankings_list_postPOST/rankingsListretrieves predicted device rankingsInfoApiinfo_execution_types_getGET/info/executionTypesget list of possible execution types for jobsInfoApiinfo_languages_getGET/info/languagesget list of languages in databaseJobsApijobs_cancel_job_id_postPOST/jobs/cancel/{jobId}cancel jobSubmissionsApisubmissions_deleteDELETE/submissionsdelete submissionsSubmissionsApisubmissions_getGET/submissionsget all user's submissionsSubmissionsApisubmissions_postPOST/submissionssubmit a new submissionSubmissionsApisubmissions_submission_name_getGET/submissions/{submissionName}get submissionsSubmissionsApisubmissions_submission_name_stream_getGET/submissions/{submissionName}/streamstream submission updatesUserApiuser_information_update_postPOST/user/informationUpdateupdate user email and nameUserApiuser_password_change_postPOST/user/passwordChangechange user password from known passwordDocumentation For ModelsAllocationBasicSuccessChangePasswordParamsCircuitCircuitInputCompilationParametersCompiledCircuitCompiledCircuitResponseControlFlowGraphCircuitCredentialsAddParametersCredentialsAqtCredentialsBasicCredentialsDeleteParametersCredentialsHoneywellCredentialsIbmCredentialsIbmProviderCredentialsRigettiCredentialsVendorDeleteSubmissionParametersDeviceDetailsDeviceListResponseDeviceRankingDeviceRankingResponseDeviceRankingsParametersExecutionParametersExecutionResultsGateInfoGetResponseInfoGetResponseDataJobJobAllocationsJobCostsJobErrorsJobExecutionLoginResponseOwnerDetailsOwnerDetailsOwnersPidResponseQubitReservationResultsDataResultsDataMeasurementsSubmissionSubmissionDetailResponseSubmissionSummarySubmissionSummaryJobsSubmissionSummaryResponseTranslationParametersTranslationResponseUpdateUserInformationParamsUserInfoVisualizationResponseDocumentation For AuthorizationAliro users can retrieve their API key in their account page athttps://app.aliro.io/JwtKeyAuthType: API keyAPI key parameter name: AuthorizationLocation: HTTP [email protected]
aliro-quantum-networking
aliro-aqnThis is an api for the Aliro Q.NetworkThis Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.50.0Package version: 1.50.0Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python 2.7 and 3.4+Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallaliro-quantum-networkingThen import the package:importaliro_quantum_networkingGetting Started## Import necessary modulesimportaliro_quantum_networkingfromcontextlibimportcontextmanagerfromaliro_quantum_networking.modelsimportClassicalChannel,MemoryInput,Node,QuantumConnection,\Request,SubmissionAqnInput,SubmissionAqnOutput,SubmissionAqnBaseGlobalSettings,SubmissionOverviewInputfromaliro_quantum_networking.restimportApiExceptionfrompprintimportpprintfrommatplotlibimportpyplotaspltfromtypingimportContextManagerimportuuid## Set up authentication# You can retrieve your API token in your "Account" page at https://aqn.aliro.io/#/userconfiguration=aliro_quantum_networking.Configuration()configuration.api_key['Authorization']='API_TOKEN'configuration.host='https://aqn.aliro.io/v1'## Define nodes# Define the nodes in your topology.## In this example, there will be a linear topology, having two end nodes with 25 quantum memories and 1 repeater between them with 50 quantum memories.default_coherence_time=10# secondsdefault_raw_fidelity=0.85memory_request_size=5defnew_node_memory()->MemoryInput:returnMemoryInput(coherence_time=default_coherence_time,memory_type='MemoryInput',raw_fidelity=default_raw_fidelity)end_node_1=Node(name='alice',memories=[new_node_memory()foriinrange(memory_request_size)])end_node_2=Node(name='bob',memories=[new_node_memory()foriinrange(memory_request_size)])repeater_1=Node(name='repeater1',memories=[new_node_memory()foriinrange(memory_request_size*2)])submission_nodes=[end_node_1,repeater_1,end_node_2]## Define quantum connections# Define the quantum connections between nodes in your topology.## In this example, there will be two quantum connections, one between the repeater and each of the end nodes.default_quantum_connection_attenuation=1e-5# decibels/kilometerdefault_quantum_channel_distance=5e3# metersquantum_connections=[QuantumConnection(attenuation=default_quantum_connection_attenuation,distance=default_quantum_channel_distance,node_from=submission_nodes[0].name,node_to=submission_nodes[1].name),QuantumConnection(attenuation=default_quantum_connection_attenuation,distance=default_quantum_channel_distance,node_from=submission_nodes[1].name,node_to=submission_nodes[2].name)]## Define classical channels# Define the classical channels between nodes in the topology.## In this example, there will be an all-to-all classical connection topology.default_classical_channel_delay=25e7# picosecondsdefault_classical_channel_distance=1e3# meterssubmission_classical_channels=[]foriinsubmission_nodes:forjinsubmission_nodes:ifi.name!=j.name:submission_classical_channels.append(ClassicalChannel(delay=default_classical_channel_delay,distance=default_classical_channel_distance,node_from=i.name,node_to=j.name))## Define the desired network request# Define the desired network request to simulatedefault_request_target_fidelity=0.9default_request_simulation_start_time=1e12default_request_simulation_end_time=1e14network_request=Request(memory_size=memory_request_size,node_from=submission_nodes[0].name,node_to=submission_nodes[2].name,target_fidelity=default_request_target_fidelity,time_beginning=default_request_simulation_start_time,time_end=default_request_simulation_end_time)## Define full submission API input# Put all inputs into the full input to send to the Aliro APIsubmission_name=f'SubmissionTest_{uuid.uuid4().hex}'submission_input=SubmissionAqnInput(classical_channels=submission_classical_channels,global_settings=SubmissionAqnBaseGlobalSettings(excitation_rate=80000000,purification_protocol_name='BBPSSW_X'),nodes=submission_nodes,quantum_connections=quantum_connections,request=network_request,submission_overview=SubmissionOverviewInput(name=submission_name,runs=1,timeout=10,timeline_stop_time=3e12,submission_overview_type='SubmissionOverviewInput'))## Define submissions API instance context# This will set up our API client and catch errors.# This will be the same for all of our calls in this example, so we can define a reusable context here.@contextmanagerdefsubmissions_api_client(api_method_name:str)->ContextManager[aliro_quantum_networking.SubmissionsApi]:withaliro_quantum_networking.ApiClient(configuration)asapi_client:submissions_api_instance=aliro_quantum_networking.SubmissionsApi(api_client)try:yieldsubmissions_api_instanceexceptApiExceptionase:print(f"Exception when calling SubmissionsApi->{api_method_name}:{e}\n")## Submit the new submissionsubmission_id:strwithsubmissions_api_client(api_method_name='submissions_post')assubmissions_api_instance:submission_api_response=submissions_api_instance.submissions_post(submission_aqn_input=submission_input)pprint(submission_api_response)submission_id=submission_api_response.submission_id## Wait for completion# This will likely take a few minutes or more.submission_details:SubmissionAqnOutputwithsubmissions_api_client(api_method_name='submissions_details_stream_get')assubmissions_api_instance:forsubmission_get_responseinsubmissions_api_instance.submissions_details_stream_get(submission_id=submission_id):submission_details=submission_get_responsesubmission_is_complete=submission_details.submission_overview.complete_dateifsubmission_is_complete:break## Display number of entangled memoriesPICOSECONDS_PER_SECOND=1e12fig,axes=plt.subplots(1,3)axes[0].set_ylabel("Number of Entangled Memories")axes[1].set_xlabel("Simulation Time (s)")first_run_results=submission_details.run_results[0]node_names=[submission_node.nameforsubmission_nodeinsubmission_nodes]result_memories_all_nodes=[first_run_results.nodes[node_name].memoriesfornode_nameinnode_names]fornode_name,node_result_memories,axisinzip(node_names,result_memories_all_nodes,axes):data=sorted(info.entangled_at_time/PICOSECONDS_PER_SECONDforinfoinnode_result_memoriesifinfo.entangled_at_time)axis.set_title(node_name)axis.plot(data,range(1,len(data)+1),marker="o")fig.tight_layout()## Display fidelities for entangled memoriesfig,axes=plt.subplots(1,3)axes[0].set_ylabel("Fidelity")axes[1].set_xlabel("Memory Number")defset_ax_properties(axis,data):data_length=len(data)axis.bar(range(data_length),data)forfidelityin(default_raw_fidelity,0.9):axis.plot([0,data_length],2*[fidelity],"k--")axis.set_ylim(0.7,1)fornode_name,node_result_memories,axisinzip(node_names,result_memories_all_nodes,axes):data=[info.fidelityforinfoinnode_result_memories]axis.set_title(node_name)set_ax_properties(axis,data)fig.tight_layout()Documentation for API EndpointsAll URIs are relative tohttp://localhost:3998/v1ClassMethodHTTP requestDescriptionAuthenticationApiauth_login_postPOST/auth/loginlogin using username and passwordSubmissionsApisubmissions_details_stream_getGET/submissions/details/streamget details about a submission's resultsSubmissionsApisubmissions_postPOST/submissionssubmit a new submissionUserApiuser_api_key_postPOST/user/apiKeygenerate Aliro API key for userUserApiuser_information_update_postPOST/user/informationUpdateupdate user email and nameUserApiuser_password_change_postPOST/user/passwordChangechange user password from known passwordDocumentation For ModelsApiKeyApiKeyResponseBasicSuccessChangePasswordParametersClassicalChannelCredentialsBasicLoginResponseMemoryMemoryBaseMemoryInputMemoryOutputMemoryOutputAllOfNodeQuantumConnectionRequestSubmissionAqnSubmissionAqnBaseSubmissionAqnInputSubmissionAqnOutputSubmissionAqnOutputAllOfUpdateUserInformationParametersUserInfoDocumentation For AuthorizationJwtKeyAuthType: API keyAPI key parameter name: AuthorizationLocation: HTTP [email protected]
aliros
alirosThis package provides a command-line interface toResource Orchestration ServiceforAlibaba Cloud.LicenseCopyright (C) 2020 HE [email protected] GNU General Public License (GPL) version 3, seeCOPYING.
alirpa-pack
No description available on PyPI.
alis
Copyright (c) 2018 ALIS Hackers (ALISハッカー部)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Description: ALIS API Python Client Platform: UNKNOWN Description-Content-Type: text/x-rst
ali-sa7bi-mon-frere
Failed to fetch description. HTTP Status Code: 404
alis-build-client
A lightweight library for Connecting to Google Cloud Run EndpointsThis is a lightweight library for making authenticated calls to Cloud Run endpoints with Python clients.
alise
Account LInking SErviceTool to link accountsInstallationAccount LInking SErvice is available onPyPI. Install usingpip:pip install aliseYou can also install from the git repository:git clone https://github.com/marcvs/alise pip install -e ./alise
alisk
Failed to fetch description. HTTP Status Code: 404
alisms
No description available on PyPI.
ali-sms-api
简介阿里云短信 SDK官方文档注意:这个接口仅仅是为了内部使用,虽然您可以获取它的源代码,但是请不要使用在您的项目中. 当前我们并不对兼容性以及可用性做任何保证。(如果需要使用请联系开发者获取支持)
alisoam-fandogh-cli
Failed to fetch description. HTTP Status Code: 404
alisoam-openbaton-ems
management system that works in conjuction with Openbaton Generic-VNFM
alis-pdf
This is the homepage of our project.
alisson-cli
No description available on PyPI.
alissonlogger
modulo de logs do curso de python
alisson-logger
modulo de logs do curso de python
alissonSomav1
No description available on PyPI.
alissonSomav2
No description available on PyPI.
alissonSomav3
No description available on PyPI.
alissonSomav4
No description available on PyPI.
alist3
No description available on PyPI.
alistair
No description available on PyPI.
aliste
Aliste Smart Home SDK for Python
alist-fuse
能用 但是由于fuse机制 会大量请求服务器 体验不好 不建议使用docker:https://hub.docker.com/r/ykxvk8yl5l/alist-fuse演示视频:https://youtu.be/fl1Lp1_1AR4https://youtu.be/yEOhw2mQwyI基本完成命令行使用【可选参数--proxy-url xxxxxxxx】:./alist-fuse --alist-user XXXXXXXXX --alist-password XXXXXXX -w token保存目录 挂载点有网友反馈非邮箱登陆会登陆失败,请使用邮箱、密码方式登陆.Gmail用户请在alist后台设置密码.Docker安装演示:https://youtu.be/-JXdcD0Yfbk安装[可能需要给执行权限]在relase下载所需二进制,用命令行启动pip install alist-fusealist-fuse🚀 Help me to become a full-time open-source developer bysponsoring me on GitHubalist网盘 FUSE 磁盘挂载,主要用于配合Emby或者Jellyfin观看alist网盘内容,功能特性:1. 目前只读,不支持写入2. 支持 Linux 和 macOS,暂不支持 Windows(Mac上上传文件会闪退暂不解决).alist-webdav项目已经实现了通过 WebDAV 访问alist网盘内容,但由于 Emby 和 Jellyfin 都不支持直接访问 WebDAV 资源, 需要配合rclone之类的软件将 WebDAV 挂载为本地磁盘,而本项目则直接通过 FUSE 实现将alist网盘挂载为本地磁盘,省去使用 rclone 再做一层中转。安装macOS 需要先安装macfusebrew install --cask macfuseLinux 需要先安装 fuseDebian 系如 Ubuntu:apt-get install -y fuse3RedHat 系如 CentOS:yum install -y fuse3可以从GitHub Releases页面下载预先构建的二进制包, 也可以使用 pip 从 PyPI 下载:pipinstallalist-fuse如果系统支持Snapcraft比如 Ubuntu、Debian 等,也可以使用 snap 安装【未实现】:sudosnapinstallalist-fuseOpenWrt 路由器GitHub Releases中有预编译的 ipk 文件, 目前提供了 aarch64/arm/x86_64/i686 等架构的版本,可以下载后使用 opkg 安装,以 nanopi r4s 为例:wgethttps://github.com/ykxVK8yL5L/alist-fuse/releases/download/v0.1.1/alist-fuse_0.1.1-1_aarch64_generic.ipk wgethttps://github.com/ykxVK8yL5L/alist-fuse/releases/download/v0.1.1/luci-app-alist-fuse_0.1.1_all.ipk wgethttps://github.com/ykxVK8yL5L/alist-fuse/releases/download/v0.1.1/luci-i18n-alist-fuse-zh-cn_0.1.1-1_all.ipk opkginstallalist-fuse_0.1.1-1_aarch64_generic.ipk opkginstallluci-app-alist-fuse_0.1.1_all.ipk opkginstallluci-i18n-alist-fuse-zh-cn_0.1.1-1_all.ipk其它 CPU 架构的路由器可在GitHub Releases页面中查找对应的架构的主程序 ipk 文件下载安装。Tips: 不清楚 CPU 架构类型可通过运行opkg print-architecture命令查询。命令行用法USAGE:alist-fuse[OPTIONS]--refresh-token<REFRESH_TOKEN><PATH> ARGS:<PATH>Mountpoint OPTIONS:--allow-otherAllowotheruserstoaccessthedrive--domain-id<DOMAIN_ID>AliyunPDSdomainid-h,--helpPrinthelpinformation--alist-user<Alist_USER>[env:Alist_USER=]--alist-password<Alist_PASSWORD>[env:Alist_PASSWORD=]--proxy-url<API_URL>[env:API_URL=]-S,--read-buffer-size<READ_BUFFER_SIZE>Read/downloadbuffersizeinbytes,defaultsto10MB[default:10485760]-V,--versionPrintversioninformation-w,--workdir<WORKDIR>Workingdirectory,refresh_tokenwillbestoredinthereifspecified比如将磁盘挂载到/mnt/alistDrive目录:mkdir-p/mnt/alistDrive/var/run/alist-fuse alist-fuse--alist-userXXXXXXXXX--alist-passwordXXXXXXX-w/var/run/alist-fuse/mnt/alistDriveEmby/Jellyfin如果是直接运行在系统上的 Emby/Jellyfin,则可以直接在其控制台添加媒体库的时候选择alist网盘对应的挂载路径中的文件夹即可; 如果是 Docker 运行的 Emby/Jellyfin,则需要将alist网盘挂载路径也挂载到 Docker 容器中,假设alist网盘挂载路径为/mnt/alistDrive, 以 Jellyfin 为例(假设 Jellyfin 工作路径为/root/jellyfin)将云盘挂载到容器/media路径:dockerrun-d--namejellyfin\-v/root/jellyfin/config:/config\-v/root/jellyfin/cache:/cache\-v/mnt/alistDrive:/media\-p8096:8096\--device=/dev/dri/renderD128\--device/dev/dri/card0:/dev/dri/card0\--restartunless-stopped\jellyfin/jellyfinLicenseThis work is released under the MIT license. A copy of the license is provided in theLICENSEfile.
alis-tool
ALIS (Arch Linux Installer Script)pip install alis-toolalis --help
alistpy
alistpyAn Association List construct for PythonInstallpip install alistpyUsageThis simple library provides an AList object that should be a drop-in replacement for most dictionaries, but based on immutable data structures instead.Cheap to construct, expensive to mutate, as it isn't mutable. Every mutative method actually generates a new AList in it's place.Example:import alist # This is cheap: a = alist.AList(x=0,y=1) # This is also cheap: print(a['x']) # This is expensive: a['x'] = 12Differences to DictionariesThere's primarily two differences:Mutating the AList is expensive, rather than cheap.Setting the same key multiple times at init time is a ValueError.That is, Python is happy with:{'x': 0, 'x': 4} > {'x': 4}That sort of behaviour might be unexpected, or cause unexpected problems for the programmer.So, instead alist:alist.AList(x=0, x=4) > Exception raised, ValueErrorIssuesIssue tracker.Anonymous users (those without accounts) are welcome to submit issues.Explicit APIThere isn't one yet.Check back in future versions. For now, be guided by thetests.TestingInstallpytest, and then run it.Currently 31 tests for 21 methods.LicenseBSD-3 Clause. SeeLICENSE.mdfor more.
alist-sdk
Alist SdkAlist API 简单封装Alist API 文档安装从PyPI安装最新release版本pip install alist-sdk从GitHub安装dev版本pip install git+https://github.com/lee-cq/alist-sdk.git使用客户端或异步客户端方法签名于API基本一致。# Sync 模式fromalist_sdkimportClientclient=Client(base_url='http://localhost:5244',username="",password="",token="",# 与 Username Password 二选一)client.me()client.mkdir("/local/test")# Async 模式importasynciofromalist_sdkimportAsyncClientclient=AsyncClient(base_url='http://localhost:5244',username="",password="",token="",# 与 Username Password 二选一)asyncio.run(client.me())像使用pathlib一样操作Alist上的文件,但是需要注意的是,AlistPath的方法都是同步的,如果需要异步操作,可以使用asyncio.to_thread将同步方法转为异步方法。fromalist_sdk.path_libimportlogin_server,AlistPathlogin_server("http://localhost:5244",username='admin',password='123456')path=AlistPath('http://localhost:5244/test')path.stat()path.is_dir()path.read_text()path.iterdir()
alist-v3
Alist-API-V3根据Alist API V3文档,使用Python3实现的异步Alist V3 API SDK! 注意: 本SDK未经严格测试,请勿轻易用于生产环境安装pipinstallalist_v3使用importasynciofromalist_v3importAsyncClientasyncdefmain():asyncwithAsyncClient(usr='ur_user_name',pwd='ur_password',url="http://ur_url.com")asclient:msg=awaitclient.get_me()print(msg)print(awaitclient.post_mkdir('/aliyun/test'))print(awaitclient.post_list('/aliyun'))if__name__=='__main__':asyncio.run(main())API本SDK的Method与Alist文档中的API名称接近一致,可以参考文档使用如有问题,可提issue
alisuretool
alisuretool for PipMy Python tools which now only include print, write/read pkl, write txt, create dir.
alita
AlitaAlita is a lightweight python async web application framework.Come into use the same with Flask.Using the async/await syntax to write concurrent code.Need Python3.5+ version at least.Installingpip install alitaQuick Startfrom alita import Alita app = Alita() @app.route('/') async def hello(request): return 'Hello, World!'LinksCode:https://github.com/dwpy/alitaDocs-zh:https://dwpy.github.io/alitaDocs-en:https://dwpy.github.io/alita-docs-en
alita-graphql
alita-graphqlalita-graphql is graphql extension for Alita。Installingpip install alita-graphqlQuick Startfrom alita import Alita from alita_graphql import GraphQL class Query(graphene.ObjectType): hello = graphene.String(description='A typical hello world') def resolve_hello(self, info): return 'World' schema = graphene.Schema(query=Query) app = Alita('dw') GraphQL(schema).init_app(app)LinksCode:https://github.com/dwpy/alita-graphql