Saravanan666/pypi-org huggingface dataset:
Package: rekey
rekey======Transform collections into dicts by deriving keys from each item.### Install```pip install rekey```### Usage```from rekey import rekey# key a list of records by idpeople = [{ 'id' : 1, 'name' : 'alice', 'age' : 30 },{ 'id' : 2, 'name' : 'bob', 'age' : 24 },{ 'id' : 3, 'name' : 'charlie', 'age' : 88 },]rekey(people, 'id')=> {1 => { 'id' : 1, 'name' : 'alice', 'age' : 30},2 => { 'id' : 2, 'name' : 'bob', 'age' : 24},3 => { 'id' : 3, 'name' : 'charlie', 'age' : 88},}# create an id => value maprekey(people, 'id', 'name')=> {1 => 'alice',2 => 'bob',3 => 'charlie',}# use Rekeyables for built-in functionalityfrom rekey.rekeyable import RekeyableSetPoint = namedtuple('Point', ['name', 'x', 'y'])  # hashablepoints = RekeyableSet([Point(name='home', x=1, y=2),Point(name='work', x=3, y=6),])points.rekey('name')=> {'home' : Point(name='home', x=1, y=2),'work' : Point(name='work', x=3, y=6),}# use the Rekeyable mixin to build your ownfrom rekey.rekeyable import Rekeyableclass MyDict(dict, Rekeyable): passMyDict({'home' : {'distance' : 1, 'weather' : 'sunny' },'work' : {'distance' : 5, 'weather' : 'foggy' },}).rekey('weather', 'distance')> {'sunny' : 1,'foggy' : 5,}```
Package: rekon
rekonrekon provides a suite of reconciliation tools for operations and financeFree software: MIT licenseDocumentation:https://rekon.readthedocs.io.PyPi:https://pypi.org/project/rekonHow to use this librarySet-up virtualenv and import rekon$pipinstall--uservirtualenv$virtualenv.env$pipinstallrekonReconciliation inputs:# import rekon libraryfromrekonimportrekon# instantiate an reconciliation instancerec=rekon.Reconciliation()# load sample data from packagerec.load_sample_data()# run reconciliation on first column in col mapping and use sqlite db in memoryrec.reconcile(rec_col=1,sqlite_db=":memory:")# view results (in pretty format)rec.rec_results_pretty# to output results to a zip and open file locationrec.output_report(output_dir='~/Desktop/EXAMPLE_OUTPUT',file_name='rec-file',output_format='zip',open_file=True)# to output results to a spreadsheet (i.e. 'xlsx') and open file locationrec.output_report(output_dir='~/Desktop/EXAMPLE_OUTPUT',file_name='rec-file',output_format='xlsx',open_file=True)History0.1.6 (2018-09-18)Added ability to output reconciliation report to ‘zip’ or ‘xlsx’Added reconciliation stats for quick reference0.1.5 (2018-09-17)First release on PyPI.ability to output reconciliations within console or in a jupyter notebook
Package: rekono-cli
Command Line Interface to make requests to theRekonoAPI REST.UsageRekono API documentation is available in/api/schema/swagger-ui.htmland/api/schema/redoc/of Rekono instancesLibrary usageRekono CLI can be also used as Python 3 library, so that it's possible to create custom Rekono scripts. For example, with the following code it's possible to create a Rekono client to make custom API requests:fromrekono.client.apiimportRekonoclient=Rekono(url='https://127.0.0.1',token='my secret api token')# Create Rekono clientresponse=client.get('/api/tools/1/')# GET request to get tool with ID 1InstallationPIPpip3installrekono-cliFrom SourceInstall the required technologies: Python 3 & PIPInstall the dependencies:pip3install-rsrc/requirements.txtExecute the CLI:python3src/rekono/main.py--helpConfigurationYou can use theREKONO_TOKENenvironment variable to configure the API token for Rekono authentication.Reach UsYou can get support, ask questions, solve doubts or solve problems using:Rekono is an open source project that we really love to maintain and it's absolutely our pleasure, but we would like to offer the possibility of supporting Rekono's development via donations. At the moment, the project only needs its maintainer's time to stay up to date with new features and fix bugs. However, in the future, it could need more expensive resources like hosting, new web pages for documentation, the inclusion of premium hacking tools, etc. With the help received from our supporters, Rekono will be able to grow fastly and have the resources that it deserves. Of course, you can use the donations just to appreciate our work. Thank you for your help!The main differences between them are that BuyMeACoffe charges fees over each donation while Ko-fi doesn't and Ko-fi supports PayPal payments while BuyMeACoffe doesn'tLicenseRekono is licensed under theGNU GENERAL PUBLIC LICENSE Version 3
Package: relask
RelaskA Relay-based web development kit on Flask.Free software: BSD licenseDocumentation:https://relask.readthedocs.io.FeaturesFast web development setup with ES6, React and RelayBatteries included: React Router, Webpack and BabelServer is powered by Python, Flask and GrapheneJWT integrated, with a working example using Flask-LoginUsageInstall Relask:pipinstallgit+https://github.com/decentfox/relaskCreate a Flask application, for example:http://flask.pocoo.org/docs/quickstart/Initialize your Flask application with Relask (this requiresnpm):FLASK_APP=xxxflaskinit-relaskUnder the root path of your Flask application, createscripts/app.jswith something like this:importReactfrom"react";importReactDOMfrom"react-dom";import{Route,IndexRoute}from"react-router";importRelayfrom"react-relay";import{Relask,RelayContainer}from"babel-loader!relask";@RelayContainerclassHelloextendsReact.Component{render(){return(<div>Hello,{this.props.hello.name}!</div>);}staticrelay={fragments:{hello:()=>Relay.QL`fragment on Hello { name }`}};}ReactDOM.render((<Relask><Routepath="/"component={Hello}queries={{hello:()=>Relay.QL`query { hello }`}}/></Relask>),document.getElementById('app'));Initialize the Relask extension with something like this:importgraphenefromflaskimportFlaskfromgrapheneimportrelayfromrelaskimportRelaskclassHello(relay.Node):name=graphene.String()defresolve_name(self,args,info):return'World'@classmethoddefget_node(cls,id,info):returnHello(id=id)classQuery(graphene.ObjectType):node=relay.NodeField()hello=graphene.Field(Hello)defresolve_hello(self,args,info):returnHello.get_node(1,None)app=Flask(__name__)relask=Relask(app)relask.schema.query=QuerySee your result with one command - don’t worry about webpack any more:FLASK_APP=xxxflaskrunCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2016-06-07)First release on PyPI.
Package: relast
RelastRelast is part of the Rayse library for hp-FEA.InstallationUse the package managerpipto install Relast:pipinstallrelastLicenseRelast is licensed underGNU LGPLv3.This software relies on thePyO3library undertheApache-2.0license for ffi and ontherayoncrate under theMITandApache-2.0licenses for parallelism.
Package: relasticsearch-cli
Elasticsearch CLIElasticsearch CLI clientOverviewUsageExampleOverviewThis is a thin CLI wrapper around the ES API. Supports AWS IAM authentication.Installpip3installrelasticsearch-cliTo install with AWS IAM support,pip3installrelasticsearch-cli[aws]Usageusage: es [-h] [--body BODY] [--aws-auth AWS_AUTH]
          [--aws-domain AWS_DOMAIN] [--endpoint ENDPOINT]
          [--username USERNAME]
          {DELETE,GET,HEAD,PATCH,POST,PUT} path

positional arguments:
  {DELETE,GET,HEAD,PATCH,POST,PUT}
                        HTTP method
  path

optional arguments:
  -h, --help            show this help message and exit
  --body BODY           Request body
  --aws-auth AWS_AUTH
  --aws-domain AWS_DOMAIN
                        AWS domain
  --endpoint ENDPOINT   Endpoint URL, without the path
  --username USERNAME   Username for basic authExampleList indices:es--endpointhttp://localhost:9200GET/_cat/indicesgreen open .kibana_1        XTv6AdigRqWMafUfInRsTg 1 1List indices for AWS Elasticsearch:es--aws-domainexampleGET/_cat/indices
Package: relastii
RelastIIRelastII is part of the Rayse library for hp-FEA.InstallationUse the package managerpipto install RelastII:pipinstallrelastiiLicenseRelastII is licensed underGNU LGPLv3.This software relies on thePyO3library undertheApache-2.0license for ffi and ontherayoncrate under theMITandApache-2.0licenses for parallelism.
Package: related-ontologies
Related Clinical OntologiesA package to suggest related clinical ontologies(LOINC, SNOMED-CT, etc.)Table of ContentsAboutGetting StartedPrerequisitesInstallationUsageLicenseAcknowledgmentsAbout...(back to top)Getting Started...(back to top)RequirementsThe package requires the following to run:Pandas~=1.4.2NumPy~=1.22.3SciPy~=1.7.3Scikit-learn~=1.1.1PyYAML>= 6.0Ftfy>= 6.1.1Fuzzywuzzy>= 0.18.0Jaro-Winkler>= 2.0.0All packages are listed inrequirements.txt.(back to top)Installationpipinstallrelated_ontologies(back to top)Usageimport related_ontologies(back to top)LicenseDistributed under theMITLicense.(back to top)AcknowledgmentsAlistair Johnson, DPhil | The Hospital for Sick Children(back to top)
Package: relatio
relatioA Python package to extract underlying narrative statements from text."relatio" is Latin for "storytelling" (pronouncedreh-LOTT-ee-oh).Motivated, described, and applied in "Text Semantics Capture Political and Economic Narratives" (2021).Interactive tutorial notebook ishere.Seeherefor graphical demo of system outputs.What can this package do?Identify Agent-Verb-Patient (AVP) / Subject-Verb-Object (SVO) triplets in the textAVPs are obtained via Semantic Role Labeling.SVOs are obtained via Dependency Parsing.A concrete example of AVP/SVO extraction:Original sentence: "Taxes kill jobs and hinder innovation."Triplets: [('taxes', 'kill', 'jobs'), ('taxes','hinder','innovation')]Group agents and patients into interpretable entities in two ways:Supervised classification of entities. Simply provide a list of entities and we will filter the triplets for you (e.g., ['Barack Obama', 'government', ...]).Unsupervised classification via clustering of entities. We represent agents and patients as text embeddings and cluster them via KMeans or HDBSCAN. The optimal number of topics is data-driven.A concrete example of a cluster:Interpretable entity: "tax"Related phrases: ['income tax', 'the tax rates', 'taxation in this country', etc.]Visualize clusters and resulting narratives.We currently support French and English out-of-the-box. You can also provide us with a custom SVO-extraction function for any language supported by spaCy.InstallationRuns on Linux and macOS (x86 platform) and it requires Python 3.7 (or 3.8) and pip.It is highly recommended to use a virtual environment (or conda environment) for the installation.# upgrade pip, wheel and setuptoolspython-mpipinstall-Upipwheelsetuptools# install the packagepython-mpipinstall-UrelatioIn case you want to use Jupyter make sure that you have it installed in the current environment.QuickstartPlease see our hands-on tutorials:Trump Tweet ArchiveTweets of French PoliticiansTeamrelatiois brought to you byElliott Ash, ETH ZurichGermain Gauthier, CRESTAndrei Plamada, ETH ZurichPhiline Widmer, University of St.Gallenwith a special thanks for support ofETH Scientific IT Services.If you are interested in contributing to the project please read theDevelopment Guide.DisclaimerRemember that this is a research tool :)
Package: relational
A Minimal Relational FunctionPyTorch/Numpy agnostic function implementing the relational block from "A simple neural network module for relational reasoning".I wrote this to learn how to usenbdev. I'm pretty sure it's correct but it only implements the core function for using relational networks and none of the other stuff (such asnn.Moduleclasses etc) thatKai included in the pull request.The original paper can be foundhere.Installpip install relationalHow to useThis can be used to implement a relational network in PyTorch. An example would be something like:fromrelational.coreimportrelationimporttorchimporttorch.nnasnnclassSetNet(nn.Module):def__init__(self,datadim,n_hidden):super(SetNet,self).__init__()self.n_hidden=n_hiddenself.g=nn.Sequential(nn.Linear(datadim*2,n_hidden),nn.ReLU(),nn.Linear(n_hidden,n_hidden))self.f=nn.Sequential(nn.Linear(n_hidden,n_hidden),nn.ReLU(),nn.Linear(n_hidden,n_hidden))defforward(self,x):n,t,d=x.size()x=relation(x,self.g,reduction='mean')returnself.f(x)x=torch.randn(4,8,16)setnet=SetNet(x.size(2),10)setnet(x).size()torch.Size([4, 10])
Package: relationaldb
relationaldbRelationalDB is a python ODM library for MongoDB that allows you to design collections like you do it for your normal dataclasses objects.DISCLAMERThis library is in alpha-release, it's a work in progress for the moment, excellent libraries for MongoDB ODM in python exist:https://github.com/roman-right/beanie/There are a lot of none implemented main features (I implement them when I have time or when I need it for my project).Quickstartrelationaldb wrapsattrsto create classes boilerplate and add few parameters.One to Many relationLet's say you want a simple one to many relations, with two entities: Animal and Person.Each animal can have one owner (Person)Each person can have 0 to many animalsfromrelationaldbimportconception# Object to design the architecture of the databasec=conception()# Add collection woth 'define' like with attrs@c.defineclassPerson:# add new attribute with 'field' method# in_filter_query parameter allows to use the 'db.Person.feed' method to upsert new documentsname:str=c.field(in_filter_query=True)# all attrs.fields parameters are availablemoney:int=c.field(kw_only=True,default=0)birth_year:int=c.field(kw_only=True,default=None)@c.defineclassAnimal:# We can referencename:Person=c.field(in_filter_query=True)owner:Person=c.field(kw_only=True,default=None)birth_year:int=c.field(kw_only=True,default=None)# Create a new mongodb named "mydb"db=c.mongodb("relationaldb_mydb_01")# Create second DB with same architecturedb2=c.mongodb("relationaldb_mydb_02")# Create a new persondb.Person.insert_one("John")# Get the personperson=db.Person.first()assertisinstance(person,Person)assertperson.name=="John"forpersonindb.Person:print(person)# Upsert (create or update) person named 'Smith' if it does not exists (based on in_filter_query)db.Person.feed("Smith")# will create the persondb.Person.feed("Smith")# will do nothing, person already existdb.Person.feed("Smith",money=1000)# will update the person 'Smith'
Package: relational-stream
Python Relational Stream AnalysisA Python (3.9+) library for relational stream analysis. Define sequences ("flows") of events, each of which may depend on a previous event in the flow, and collect all such flows from a stream. This is particularly useful for analyzing network captures, as after identifying a certain flow of events (e.g. a series of network requests used to authenticate a user), this library can be used to easily filter out all such flows from a larger capture. This is highly resilient to extraneous requests occurring in the middle of long-running flows, so it can easily be used to target individual applications within complete network captures from system-wide MITM attacks.ExampleIt can be a bit hard to wrap your head around what this library does just from a written description, so let's take a look at a code example. The following shows a class which can be used to analyze a stream of strings, filtering out sequences with a predefined format. However, the included classes are fully generic, so a similarFlowcould easily be created for a stream of HTTP requests.importrefromtypingimportOptionalfromrelational_streamimportFlow,RelationalStreamclassSomeStringFlow(Flow[str]):"""Simple flow example to identify a sequence of strings using regex. This flow will match a seriesof the events in the form::"start A""A -> B or C""B" OR "C""""first_char:Optional[str]=Nonesecond_char_options:Optional[set[str]]=Nonesecond_char_choice:Optional[str]=NoneEVENT_REGEXES=[r"start (\w)",r"(\w) -> (\w) or (\w)",r"(\w)",]defis_next_event(self,event:str)->bool:iflen(self.events)==0:match=re.match(self.EVENT_REGEXES[0],event)ifmatchisNone:returnFalseself.first_char=match[1]returnTrueeliflen(self.events)==1:match=re.match(self.EVENT_REGEXES[1],event)ifmatchisNoneormatch[1]!=self.first_char:returnFalseself.second_char_options={match[2],match[3]}returnTrueelse:# len(self.events) == 2assertself.second_char_optionsisnotNonematch=re.match(self.EVENT_REGEXES[2],event)ifmatchisNoneormatch[1]notinself.second_char_options:returnFalseself.second_char_choice=match[1]returnTruedefis_complete(self)->bool:returnlen(self.events)==3stream=RelationalStream([SomeStringFlow])stream.ingest("start A")stream.ingest("B")stream.ingest("A -> B or C")stream.ingest("A -> D or E")stream.ingest("B")# len(stream.incomplete_flows(SomeStringFlow)) == 0# len(stream.completed_flows(SomeStringFlow)) == 1# stream.completed_flows(SomeStringFlow)[0].first_char == "A"# stream.completed_flows(SomeStringFlow)[0].second_char_options == {"B", "C"}# stream.completed_flows(SomeStringFlow)[0].second_char_choice == "B"As you can see, the addition of extraneous data in the middle of the stream has no effect on the completed flows. A need for this resilience when developing tools to analyze network captures was the primary motivation for developing this library.Installationpip3 install relational-stream
Package: relation-graph
Relation Graph, Python PortThis is a minimal implementation ofrelation-graphin PythonThe goal is to reason over a minimal subsetsubClassOfsomeValuesFromtransitive propertiesproperty chainsTo run:run_relation_graph("tests/input/test.csv","tests/output/results.csv")input must be csvheaders must be subject, predicate, objectdomain entities can be any syntax, rdf/owl terms must be CURIEsrows are either:relation graph direct edgestriples of the formPRED,rdf:type,owl:TransitivePropertySee tests/input for detailsTODOreflexive edgesrelax equivalence to paired subClassOfcompare with scala relation-graphproperty chains
Package: relations-dil
relations-dilDB/API ModelingRelations is designed to be a simple, straight forward, flexible DIL (data interface layer).Quite different from other DIL's, it has the singular, microservice based purpose to:Create models with very little code, independent of backendsCreate CRUD API with a database backend from those models with very little codeCreate microservices to use those same models but with that CRUD API as the backendYa, that last one is kinda new I guess.Say we create a service, composed of microservices, which in turn is to be consumed by other services made of microservices.You should only need to define the model once. Your conceptual structure is the same, to the DB, the API, and anything using that API. You shouldn't have say that structure over and over. You shouldn't have to define CRUD endpoints over and over. That's so boring, tedious, and unnecessary.Furthermore, the conceptual structure is based not the backend of what you've going to use at that moment of time (scaling matters) but on the relations, how the pieces interact. If you know the structure of the data, that's all you need to interact with the data.So with Relations, Models and Fields are defined independent of any backend, which instead is set at runtime. So the API will use a DB, everything else will use that API.This is package is just a piece of that whole process, the base abstract classes, etc. But with a mock source, you can see how it all works.Exampleimportrelations# The SOURCE in a model is a string, used to access a source in Relations's global registryclassBase(relations.Model):SOURCE="example"# The Models automatically have the same SOURCE by using this BaseclassUnit(Base):id=intname=strclassTest(Base):id=intunit_id=int# Relations aren't defined here, but outside the modelsname=str# Creation a Relation from unit.id to test.unit_id (default)relations.OneToMany(Unit,Test)# This defines the "example" source to be an in memory storerelations.unittest.MockSource("example")# Create Unit named yep and storeUnit("yep").create()# Query a single Unit with the name "yep" and access its idUnit.one(name="yep").id# 1# Create two Units, named people and stuff, because name is the first non readdonly fieldUnit([["people"],["stuff"]]).create()# Retrieve a single Unit with name stuff, and set the name to "things" (but don't save)unit=Unit.one(name="stuff").set(name="things")# Save the update (returns number of records updated))unit.update()# 1# Retrieve a single Unit with id 2, and set the name to "thing"unit=Unit.one(2)unit.name="thing"# Add a child test with name "more" (first non readonly that's not already set)unit.test.add("moar")unit.update()# Find all the Tests with a parent Unit with name "thing", and an id greater than 0tests=Test.many(unit__name="thing",id__gt=0)tests[0].name# "moar"
Package: relationship-structure-identification
Simulations to identify the relationship structure among multiple datasets using Independent Vector AnalysisThis package contains the code for reproducing the simulations of our paper:Isabell Lehmann, Tanuj Hasija, Ben Gabrielson, M. A. B. S. Akhonda, Vince D. Calhoun, TÃ¼lay Adali,Identifying the Relationship Structure among Multiple Datasets Using Independent Vector Analysis: Application to Multi-task fMRI Data,submitted in 2023Installing this PackageThe only pre-requisite is to havePython 3(version >=3.11) installed. This package can be
installed (optionally in a virtual environment) with:git clone https://github.com/SSTGroup/relationship_structure_identification
cd relationship_structure_identification
pip install -e .Required third-party packages will automatically be installed.Generating Simulations and ResultsThe simulated data is generated with:cd relationship_structure_identification
python simulations.py @../simulations/simulation_parameters.txtAfter running the code, the folderrelationship_structure_identification/simulationswill contain the generated .npy files,
consisting of the true data and the estimated results for IVA-L-SOS, the bootstrap and the clustering, for each Monte-Carlo run.Then, the performance metrics are calcuted with (from the relationship_structure_identification folder):python performance_metrics.py @../simulations/performance_parameters.txtThe .npy files containing the performace metrics will also be saved in thesimulationsfolder.Visualizing ResultsAfter having calculated the performance metrics, the boxplots can be generated by running the
notebook.
Themetrics_rhoxx.npyfiles must be in thesimulationsfolder.Changing ParametersBy changing the scenario inparameters.txt, the simulations for different values of 'rho' are generated.
The other parameters are set to the values according to the simulations in our paper.
The default values can be changed by adding the parameters to thesimulation_parameters.txtorperformance_parameters.txtfiles.ContactIn case of questions, suggestions, problems etc. please send an email toisabell.lehmann@sst.upb.de,
or open an issue here on Github.CitingIf you use this code in an academic paper, please cite [1]@article{Lehmann2023,
  title   = {Identifying the Relationship Structure among Multiple Datasets Using Independent Vector Analysis: Application to Multi-task fMRI Data},
  author  = {Lehmann, Isabell and Hasija, Tanuj and Gabrielson, Ben and Akhonda, M. A. B. S. and Calhoun, Vince D. and Adali, T{\"u}lay},
  booktitle={tba},
  pages={tba},
  year={2023}
  }[1] Isabell Lehmann, Tanuj Hasija, et al.,Identifying the Relationship Structure among Multiple Datasets Using Independent Vector Analysis: Application to Multi-task fMRI Data,submitted in 2023.