Saravanan666/pypi-org huggingface dataset:
Package: scheduling-utils
LR Schedulers with C++ extensionsImplements some LR scheduling functions to decay or ramp values across timestamps.InstallInstall with:pip install scheduling_utilsUsageEach scheduler is available with full python code or c++ code
(ctypesis used for binding)
wrapped into python classes.To initialize and use for example a cosine scheduler, do the following:# import the c++ cosine scheduler
from schedulers_cpp import CosineScheduler

# use this to use the full python version
# from schedulers import CosineScheduler

start_step = 0
stop_step = 10

start_value = 5
stop_value = 20

scheduler = CosineScheduler(start_step, stop_step, start_value, stop_value)

# get values corresponding to step
for step in range(10):
    value = scheduler.step(step)Available SchedulersAvailable Schedulers at current version:Linear:Cosine:LinearCosine:
Package: schedview
schedviewTheschedviewmodule provides tools for visualizing Rubin Observatory scheduler behaviour and Rubin Observatory/LSST survey status, including:A collection of functions, eacho of which creates an independent visualization of some aspect of scheduler behaviour, state, or surve progress. These functions may be used injupyternotebooks or other python applications, or combined into dashboards or other higher level applications.A handful of dashboard applications that collect relevant visualizations into sets suitable for specific use cases.
Package: scheil
A Scheil-Gulliver simulation tool usingpycalphad.importmatplotlib.pyplotaspltfrompycalphadimportDatabase,variablesasvfromscheilimportsimulate_scheil_solidification# setup the simulation parametersdbf=Database('alzn_mey.tdb')comps=['AL','ZN','VA']phases=sorted(dbf.phases.keys())liquid_phase_name='LIQUID'initial_composition={v.X('ZN'):0.3}start_temperature=850# perform the simulationsol_res=simulate_scheil_solidification(dbf,comps,phases,initial_composition,start_temperature,step_temperature=1.0)# plot the resultforphase_name,amountsinsol_res.cum_phase_amounts.items():plt.plot(sol_res.temperatures,amounts,label=phase_name)plt.plot(sol_res.temperatures,sol_res.fraction_liquid,label='LIQUID')plt.ylabel('Phase Fraction')plt.xlabel('Temperature (K)')plt.title('Al-30Zn Scheil simulation, phase fractions')plt.legend(loc='best')plt.show()Installationpip (recommended)scheil is suggested to be installed from PyPI.pipinstallscheilAnacondacondainstall-cconda-forgescheilDevelopment versionsTo install an editable development version with pip:gitclonehttps://github.com/pycalphad/scheil.gitcdscheilpipinstall--editable.[dev]Upgrading scheil later requires you to rungit pullin this directory.Run the automated tests usingpytestTheoryUses classic Scheil-Gulliver theory (see G.H. Gulliver,J. Inst. Met.9 (1913) 120–157 and Scheil,Zeitschrift Für Met.34 (1942) 70–72.) with assumptions ofPerfect mixing in the liquidLocal equilibrium between solid and liquidNo diffusion in the solidGetting HelpFor help on installing and using scheil, please join thepycalphad/pycalphad Gitter room.Bugs and software issues should be reported onGitHub.Licensescheil is MIT licensed. See LICENSE.CitingIf you use thescheilpackage in your work, please cite the relevant version.The following DOI,doi:10.5281/zenodo.3630656, will link to the latest released version of the code on Zenodo where you can cite the specific version that you haved used. For example, version 0.1.2 can be cited as:Bocklund, Brandon, Bobbio, Lourdes D., Otis, Richard A., Beese, Allison M., & Liu, Zi-Kui. (2020, January 29). pycalphad-scheil: 0.1.2 (Version 0.1.2). Zenodo. http://doi.org/10.5281/zenodo.3630657@software{bocklund_brandon_2020_3630657,
  author       = {Bocklund, Brandon and
                  Bobbio, Lourdes D. and
                  Otis, Richard A. and
                  Beese, Allison M. and
                  Liu, Zi-Kui},
  title        = {pycalphad-scheil: 0.1.2},
  month        = jan,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {0.1.2},
  doi          = {10.5281/zenodo.3630657},
  url          = {https://doi.org/10.5281/zenodo.3630657}
}
Package: schelling-model
schellings-modelschellings model of racial segregationDescriptionIn this project i'm gona a developa a simulation of Schellings model of racial segregation to study witch factorm lead to the segregation of the population in citys.The project will have a firs version where the only parameter that will be taken in acount is the satisfaction ratio that defins how satisfaid is a person with is neighbors, the parametes defins the minimal number of same kinf neighborus each egent neads to be happy in the position that is raight now and if it's not happy with the position the agent will move to a vacant position, this proces will be repited until all the agents are happy or until ther is no more vacant places where to be happy.Graphic interfaceUsing the streamlit library we can play with the vaues of diferent paraemters to see what happends on each case.Version 2In this version 2 i will aplay the clasic Schelling, considerein only one muvment at a time and onli moving if there is a position where it will be happy.
Package: schem
SChemhttps://pypi.org/project/schem/. Install withpip install schemClean Room implementation of the backend of SpaceChem (https://www.zachtronics.com/spacechem).Usage (CLI)python -m schem [-h] [--version] [-l LEVEL_FILE] [--max-cycles MAX_CYCLES]
                [--check-precog] [--max-precog-check-cycles MAX_PRECOG_CHECK_CYCLES]
                [--seed SEED] [--hash-states HASH_STATES]
                [--export] [--no-run] [--strict]
                [--json | --verbose] [--debug [DEBUG]]
                [solution_files ...]E.g.python -m schemwill validate the cycles-reactors-symbols score of any solution export(s) in the user's clipboard. Seepython -m schem --helpfor details.Usage (python)Supposinglevel_export,solution_exportare strings as exported by SpaceChem CE:fromschemimportLevel,Solution# Load a solutionsolution=Solution(solution_export)# Auto-use appropriate official levelsolution=Solution(solution_export,level=level_export)# Custom levelsolution=Solution(solution_export,level=Level(level_export))# Alternative# Run a solutionsolution.run()# => Score(cycles=45, reactors=1, symbols=14)# Check the expected score that was in the export's metadatasolution.expected_score# => Score(cycles=44, reactors=1, symbols=14)# Reset the run state of a solutionsolution.reset()# Validate that a solution matched its expected scoresolution.validate()# =/> ScoreError("[Of Pancakes and Spaceships] 44-1-14 "Cycles" by Zig: Expected 44 cycles but got 45.")# Check if a solution uses precognitionsolution.is_precognitive()# slow# => False# Bundle method for calling validate() if expected score is present, else run(), optionally checking precog,# and returning a dict of all this info and any errorsolution.evaluate()# => {"level_name": "Tunnels III",#     "resnet_id": (1, 1, 3),  # Volume, Issue, Puzzle#     "author": "Zig",#     "cycles": 244,#     "reactors": 1,#     "symbols": 14,#     "solution_name": "symbols",#     "error": ScoreError("[Tunnels III] 243-1-14 \"symbols\" by Zig: Expected 243 cycles but got 244.")#}solution.evaluate(check_precog=True)# => {"level_name": "Challenge: Going Green",#     "author": "Zig",#     "cycles: 3578,#     "reactors": 1,#     "symbols": 103,#     "solution_name": "assumes 2nd input",#     "precog": true,#     "precog_explanation": "Solution is precognitive; failed whenever molecule 2 was Hydrogen Sulfide, for 9 such#                            appearances (whereas solution success rate was otherwise 100%)."#}# Re-export the solution. Sorts export lines to ensure uniquenesssolution.export_str()# => "SOLUTION:..."
Package: schema2rst
schema2rstgenerates reST doc from database schemaFeaturesGenerates table definitions document from database schema.schema2rstrecognizes your database comments on tables and columns,
and reflect it to docs.SetupUse easy_install (or pip):$ sudo easy_install schema2rstConfigurationMake config.yaml to connect your database server.
This is example for MySQL Server:type: mysql
db: sample
host: localhost
user: username
passwd: passw0rdtypeparameter is accept these values: mysql, mysql+pymysql, postgresqlUsageExecute schema2rst command:$ schema2rst -c config.yaml -o database.rstExamplesYou can see example athttp://tk0miya.bitbucket.org/schema2rst/build/html/.RequirementsPython 2.6, 2.7, 3.2, 3.3SQLAlchemyPyYAMLSixpymysql or MySQL-python (optional)psycopg2 (optional)LicenseApache License 2.0
Package: schema-automator
LinkML Schema AutomatorThis is a toolkit that assists with the generation and enhancement ofLinkMLschemasInstallpipinstallschema-automatorCommand LineSeeCLI docsGeneralizing:schemautogeneralize-tsvmy-data.tsv>my-schema.yamlImporting:schemautoimport-json-schematheir.schema.json>my-schema.yamlAnnotating:schemautoannotate-schemamy-schema.yamlFull Documentationlinkml.io/schema-automator
Package: schemabuilder
Helpers to build you define JSON schema for either validation or publication.RequirementsIt requires Python 2.7 andjsonschema.jsonschemaorsetuptoolsshould be installed with Python.InstallUsing pip:pip install schemabuilderOr easy_install:easty_install schemabuilderYou may install it manually:git clone https://github.com/dinoboff/schemabuilder.git
cd schemabuilder
python setup.py installUsagePrimitivesJSON schema primitives are represented by object of type:schemabuilder.Strschemabuilder.Boolschemabuilder.Numberschemabuilder.Intschemabuilder.Objectschemabuilder.Array>>>importschemabuilderasjsb>>>importpprint>>>>>>name=jsb.Str(pattern="^[a-zA-Z][- 'a-zA-Z0-9]+")>>>email=jsb.Str(format="email")>>>user=jsb.Object(properties={...'name':name(required=True),...'email':email(),...'home':jsb.Str(format='uri'),...})>>>pprint.pprint(user.to_dict()){'properties':{'email':{'type':'string'},'home':{'format':'uri','type':'string'},'name':{'type':'string'}},'required':['name'],'type':'object'}SchemaSchema collects those definitions for validation (usingjsonschema) or
publication.>>>importschemabuilderasjsb>>>importpprint>>>>>>my_schemas=jsb.Schema(id='http://example.com/schemas.json#')>>>name=my_schemas.define(...'name',jsb.Str(pattern="^[a-zA-Z][- 'a-zA-Z0-9]+")...)>>>email=my_schemas.define('email',jsb.Str(format="email"))>>>user=my_schemas.define('user',jsb.Object(properties={...'name':name(required=True),...'email':email(required=True),...}))>>>>>>user.validate({'name':'bob'})Traceback(mostrecentcalllast):File"<stdin>",line1,in<module>File"schemabuilder/schema.py",line50,invalidatevalidator.validate(data)File"/Users/bob/pyenv/lib/python2.7/site-packages/jsonschema/validators.py",line117,invalidateraiseerrorjsonschema.exceptions.ValidationError:'email'isarequiredpropertyFailedvalidating'required'inschema:{'properties':{'email':{'$ref':'#/definitions/email'},'name':{'$ref':'#/definitions/name'}},'required':['name','email'],'type':'object'}Oninstance:{'name':'bob'}>>>>>>user.validate({'name':'bob','email':'bob@example.com'})>>>>>>importjson>>>printjson.dumps(my_schemas.to_dict(),indent=4){"definitions":{"email":{"type":"string","format":"email"},"user":{"required":["name","email"],"type":"object","properties":{"name":{"$ref":"#/definitions/name"},"email":{"$ref":"#/definitions/email"}}},"name":{"pattern":"^[a-zA-Z][- 'a-zA-Z0-9]+","type":"string"}},"id":"http://example.com/schemas.json#","$schema":"http://json-schema.org/draft-04/schema#"}
Package: schema-change-risk-engine
SchemaChangeRiskEngine (SCRE):A tool for assessing the risk of schema changes in a MySQL database when using tools like gh-ost or flywheel.The problemBased onImpact analysis of database schema changesand real world learning. It was found we should restrict riskier changes and patterns.Such patterns include:BLOB & TEXT column overuse and storage/memory wasteENUM columns issues with casting during value parsing of a changeSET columns issues with casting during value parsing of a changeForeign Key and Trigger usage preventing non-blocking and non-atomic changesNo Primary Key causing slow migration or table level locking verses row level lockingRenaming columns and tables leading toward application, data warehouse, and data lake sync issuesThe solutionThis tool addresses this by allowing you to pass any CREATE or ALTER statement, and it will return a boolean if it's safe.Examplefromschema_change_risk_engineimportSchemaChangeRiskEngineasSCREengine=SCRE()changeStatements=["""CREATE TABLE `test` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(255) NOT NULL,PRIMARY KEY (`id`))ENGINE=InnoDBDEFAULT CHARSET=utf8mb4COLLATE=utf8mb4_0900_ai_ci""","ALTER TABLE `test` ADD COLUMN `age` int(11) NOT NULL DEFAULT 0","ALTER TABLE `test` RENAME COLUMN `age` to `years_old`","ALTER TABLE `test` ADD COLUMN `gener` ENUM('M', 'F','T','NC') NOT NULL DEFAULT 'NC'","ALTER TABLE `test` ADD COLUMN `hobbies` SET('S', 'R','T','NC') NOT NULL DEFAULT 'NC'","ALTER TABLE `test` ADD COLUMN `bio` TEXT NOT NULL","ALTER TABLE `test` ADD COLUMN `photo` BLOB NOT NULL","ALTER TABLE `test` ADD COLUMN `order_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP","ALTER TABLE `test` ADD TRIGGER `test_trigger` AFTER INSERT ON `test` FOR EACH ROW BEGIN INSERT INTO `test` (`name`) VALUES ('test'); END","ALTER TABLE `test` ADD FOREIGN KEY (`id2`) REFERENCES `test` (`id`)","ALTER TABLE `test` RENAME TO `test2`","ALTER TABLE `test` RENAME TABLE `test2` TO `test`"]>foridx,changeinenumerate(changeStatements):print("Statement%s:%s"%(idx+1,engine.validate(change)))Statement1:(True,None)Statement2:(True,None)Statement3:(False,'Renaming columns is not allowed')Statement4:(False,'ENUM data type is not allowed')Statement5:(False,'SET is not allowed')Statement6:(False,'TEXT columns are not allowed')Statement7:(False,'BLOB columns are not allowed')Statement8:(False,'DATETIME data type is not allowed')Statement9:(False,'Triggers are not allowed')Statement10:(False,'Foreign keys are not allowed')Statement11:(False,'Renaming tables is not allowed')Statement12:(False,'Renaming tables is not allowed')
Package: schema-classification
schema-classificationThis microservice performs the classification of parse resultsUsageThe input format looks like thisinput_tokens=[{"normal":"my",},{"normal":"late",},{"normal":"transport",},{"normal":"late_transport","swaps":{"canon":"late_transport","type":"chitchat"}},]Calling the service looks like thisfromschema_classificationimportclassifyabsolute_path=os.path.normpath(os.path.join(os.getcwd(),'resources/testing','test-intents-0.1.0.yaml'))svcresult=classify(absolute_path=absolute_path,input_tokens=input_tokens)The output from this call looks like{'result':[{'classification':'Late_Transport','confidence':99}],'tokens':{'late':'','late_transport':'chitchat','my':'','transport':''}}Classification via MappingClassification of Unstructured Text is a mapping exerciseThe mapping is composed of these elementsInclude One OfInclude All OfExclude One OfExclude All OfThe classifier will map extracted entities from unstructured text using the listed elements.for example,TEST_INTENT- include_one_of:-alpha-apple-include_all_of:-beta-gamma-exclude_one_of:-delta-exclude_all_of:-epsilon-digammaThis intent will be selected if the set of extracted entities has eitheralphaorappleand has both(beta, gamma). The intent will be discarded ifdeltaoccurs or if both(epsilon, digamma)occur.In python, everything can be loaded into a native set structure and use native operations likedifference,intersection,union, andsymmetric difference.Because all set operations are native (underlying C modules), it's extremely fast to find an accurate classification.The system adds more smarts by figuring out what to do if the rule statesdeltais excluded, and a descendant ofdeltais present.Or ifalphashould be included and a sibling or child ofalphais present, etc.In this case, I usually rely on a heuristic to boost or lower confidence and tweak that overtime to get a good result.
Package: schema-cntl
schema_cntlAPythonlibrary created byMakpar Innovation Labfor versioning database schemas. Currently compatible withPostgreSQL.schema_cntlusesAWS QLDBto maintain a revision history of aschema.json. This file defines the schema at a single point in time. Asschema.jsonchanges are committed, the revision history expands. This library generatesSQLstatements that allow the user to transform the schema from one revision to another.SetupPyPi PackageThis is a command line utility. To use it, you must install the latest distribution fromPyPi,pip install schema_cntlQLDBThis library usesinnoldb, another package supported by theMakpar Innovation Lab, to persist theschema.jsonto anAWS Quantum Ledger Database. As such, in order to use this package, you will need to create aQLDBledger and anIAMaccount with permissions to access that ledger. For more detailed instructions on setting the necesssary resources onAWS,refer to the innoldb documentationEnvironment VariablesYou will need to point theLEDGERenvironment variable to the name of theQLDBledger and theTABLEenvironment variable to the name of the table you intend to use. The ledger must exist, but if the table does not exist,schema_cntlwill create a new one.exportLEDGER="<ledger-name>"exportTABLE="<table>"Schema JSONA database schema is specified through a JSON configuration file formatted as follows,{"schema":{"name":"<schema-name>","engine":"<postgres | ... >","tables":[{"name":"<table-name>","columns":[{"name":"<name>","type":"<bool | varchar | float8 | int | decimal | date> : ignored if primary key == true","limit":"<limit> : optional, defaults to None","primary_key":"<true | false> : optional, defaults to false","foreign_key_references":"<fk> : optional, defaults to None","not_null":"<true | false> : optional, defaults to false"}]}]}}For example, the following schema creates a table namedtest_tablewith three fields: a primary key fieldunique_id, an integer fieldsample_intand a text fieldsample_text.{"schema":{"engine":"postgres","name":"test_schema","tables":[{"name":"test_table","columns":[{"name":"unique_id","primary_key":true},{"name":"sample_int","type":"int"},{"name":"sample_text","type":"text"}]}]}}WorkflowCommit RevisionList Revision HistoryGenerate SchemaGenerate DifferencesCommitschema_cntlcommit<path-to-schema.json>List Revision Historyschema_cntlhistory<path-to-schema.json>--limit<revision_limit>Generate Schemaschema_cntlschema<path-to-schema.json><revision>Generate Differencesschema_cntl diff <path-to-schema.json> <start_revision> <end_revision>Code Quality
Package: schema-compare
Schema CompareSchema compare is a simple utility tool with the sole goal of comparing schemas between two databases. Currently it only supports postgresql.InstallationYou can install Schema Compare from PyPi:pip install schema-compareHow to useDefine config.toml filepython schema-compare {{config.toml path}}Configuration file[source]
username = ....
password = ....
hostname = ....
database = ....

[target]
username = ....
password = ....
hostname = ....
database = ....
Package: schemaconvertor
schemaconvertor提供了一种使用schema来转换对象的方法，通过schema，可以指定该对象序列化的部分和对应的类型，其结果可以进一步序列化为json。安装：pip install schemaconvertor项目：githubpypi版本：0.3演示假设有个简单的数据类型User：fromcollectionsimportnamedtupleUser=namedtuple("User",["name","password","age"])可以通过指定schema来转换对象：schema={"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}}}user=User(name="lyc",password="schemaconvertor",age="24")fromschemaconvertor.convertorimportconvert_by_schemaprintconvert_by_schema(user,schema)输出： > {‘age’: 24, ‘name’: ‘lyc’}更多示例：demo
0.3说明基本字段versionversion字段标识着Schema版本。descriptiondescription字段标识着Schema说明。encodingencoding指定Schema的string字段的字符编码，默认是utf-8。decoderrorsdecoderrors指定Schema的string字段解码失败的操作，用于str.decode的第二个参数，主要有strict，ignore，replace三种可选参数，默认是strict。typetype字段指定对应待转换数据的最终类型，主要类型对应如下表：typePythonstringunicodeobjectdictintegerintfloatfloatnumberint/floatbooleanbooldictdictarraylistnullNoneTyperawobjecttype字段直接影响转换行为，因此基本上每个Schema都需指定type，为简化表达，当一个Schema仅有type一项时，可以直接使用type的值简化表示为Schema。typeOf当前仅在声明typeOf字段时可以不指定type，typeOf指示如何根据数据的类型选择对应的Schema。可以使用真实的Python类型或类型元组作为key（作为isinstance的第二个参数）。defaultdefault字段仅用在typeOf字段内，用于指示缺省类型表示的Schema。itemsitems字段仅在type为array时生效，用于描述序列中的每一项对应的Schema。propertiesitems字段仅在type为dict或object时生效，指定给出的项的Schema（没有指定的项不会处理）。patternPropertiesitems字段仅在type为dict或object时生效，指定符合给定的正则表达式的项的Schema（使用re.search匹配）。附加信息Schema使用lazy compile方式，仅在转换使用时自动编译，初始化代价极小。子Schema中如无显式声明，version，description，encoding，decoderrors自动继承父Schema对应的值。typeOf能够识别继承关系，但针对使用数据真实类型的情况有优化。typeOf指定多种类型时不要使用list等非hashable类型。对于object的情况是使用ObjAsDictAdapter将数据包装成类dict对象进行转换的。
Package: schemadiffed
schemadiffschemadiff is a niche package designed for situations where a — large — number of files on a filesystem are expected to have identical schemas, but they don't. This can present a challenge when working with distributed computing systems likeApache SparkorGoogle BigQuery, as unexpected schema differences can disrupt data loading and processing.Consider a scenario where you are processing thousands of files, and a subset of them have schemas that are almost identical but not completely matching. This can lead to errors such as:BigQuery:Error while reading data, error message: Parquet column '<COLUMN_NAME>' has type INT32 which does not match the target cpp_type DOUBLE File: gs://bucket/file.parquetSpark:Error: java.lang.UnsupportedOperationException: org.apache.parquet.column.values.dictionary.PlainValuesDictionary$PlainDoubleDictionaryschemadiff addresses these issues by efficiently identifying the files with schema inconsistencies through reading file metadata.InstallationInstall the package with pip:pipinstallschemadiffed# schemadiff taken :pUsageThe package can be used as a Python library or as a command-line tool.Python LibraryHere's an example of using schemadiff to group files by their schema:importosfromschemadiffimportcompare_schemasos.environ['GOOGLE_CLOUD_CREDENTIALS']='key.json'grouped_files=compare_schemas('path/to/parquet_files',report_path='/desired/path/to/report.json')In this example,compare_schemasgroups the Parquet files in the directorypath/to/parquet_filesby their schema. It saves the results toreport.jsonand also returns the grouped files as a list for potential downstream use.Command-Line Interfaceschemadiff can also be used as a command-line tool. After installation, the commandcompare-schemasis available in your shell:pythonschemadiff--dir_path'gs://<bucket>/yellow/*_2020*.parquet'--fs_type'gcs'--report_path'report.json'--return_type'as_list'FeaturesEfficient processing by reading the metadata of Parquet files.Supports local, GCS, S3 filesystems (you must be authenticated to your cloud service first).Supports wildcard characters for flexible file selection.