Saravanan666/pypi-org huggingface dataset:
Package: estpop
estpopis a Python package providing population forecasting from historical data. This method is based on cohort change ratio[1].Sample CodeChange Ratioimportnumpyasnpimportopenpyxlimportestpopsheet=openpyxl.load_workbook('data.xlsx').worksheets[0]pops={}foriinrange(1,sheet.max_row):code=sheet.cell(i+1,3).valueifnotcodeinpops:pops[code]=[]males,females=[],[]forjinrange(29,50):males.append(sheet.cell(i+1,j).value)females.append(sheet.cell(i+1,j+22).value)pops[code].append([males,females])ratios={}fork,vinpops.items():change_ratios,baby_ratios,tail_ratios=[],[],[]try:foriinrange(len(v)-5):change_ratio,baby_ratio,tail_ratio=estpop.ratios(v[i],v[i+5])change_ratios.append(change_ratio)baby_ratios.append(baby_ratio)tail_ratios.append(tail_ratio)ratios[k]={'change_ratio':np.mean(change_ratios,axis=0).tolist(),'baby_ratio':float(np.mean(baby_ratios)),'tail_ratio':float(np.mean(tail_ratios))}except:passSimulationimportopenpyxlimportestpopf=open('result.csv',mode='w')f.write('code,year\n')fork,vinpops.items():ifkin[411,421,521]:change_ratio=ratios[0]['change_ratio']baby_ratio=ratios[0]['baby_ratio']tail_ratio=ratios[0]['tail_ratio']else:change_ratio=ratios[k]['change_ratio']baby_ratio=ratios[k]['baby_ratio']tail_ratio=ratios[k]['tail_ratio']try:year=2020estimates=v[5]foriinrange(7):estimates=estpop.simulate(estimates,change_ratio,baby_ratio,tail_ratio)f.write('%s,%s,%s,%s\n'%(k,year+i*5,','.join(map(str,estimates[0])),','.join(map(str,estimates[1]))))except:print(k)f.close()ReferencesEinoshin SUZUKI, Kaoru MORI, Koichi NAGASE, Masatoshi TAMAMURA, Ikuyo KANEKO: The Development of the Future Predictive Model of 'Potentially Disappearing Neighborhood Associations' Using Demographic Data of the Neighborhood Association Base, Journal of the Japan Association of Regional Development and Vitalization, Vol.6, pp.20-30, 2015.
Package: estraces
estraces - Traces and trace sets Python library for side-channel attacksestraces is a Python library to manipulate side-channel trace sets. It aims at giving a clear and uniform API to handle
traces samples and metadata for various persistency and file formats.
It usesNumpyto handle data.estraces was originally developped and maintain byeshard, and is heavily used in the open-source
side-channel analysis frameworkscared.Getting startedRequirements and installationestraces requires and must work on Python3.6,3.7,3.8,3.9,3.10versions.Python 3.7 is outdated nowEOL dateYou can install it by several ways:from sourcewithpipwithcondaAt time of writing, we highly recommend to install fromcondawhen usingestraceswithpython 3.8.Installing from sourceTo install estraces from source, you will need the following requirements:pipandsetuptoolswith version greater than40.0For Python3.8, you'll need to build and installh5pyfrom source seeH5PY installation instructionsbefore installingestracesFrom the source code folder, run:pipinstall.Installing withpipFirst, you should update yourpipandsetuptoolsversion:pipinstall-UpipsetuptoolsIf you usePython 3.8or above, you must first build and installh5py,see instructions.pipinstallestracesInstalling withcondaTo install fromconda, simply run:condainstall-ceshardestracesOpens a trace setIf you have a trace set as binary files, you can get a trace header set by using the binary reader:# First import the libimportestraces# We suppose the binary files are under traces/ and are named something.binmy_traces=estraces.read_ths_from_bin_filenames_pattern('traces/*.bin',# First indicate the filename pattern for the bin filedtype='uint8',# Indicate the numpy dtype of the datametadatas_parsers={}# This dict allows to associate metadata)You can then read your samples:# This will return the data for the first 100 tracesmy_traces.samples[:100]# This will return the frame 0 - 1000 of all the traces as a numpy arraymy_traces.samples[:,:1000]# You can iterate on tracesfortraceinmy_traces:# do somethingDocumentationTo go further and learn all about estraces, please go tothe full documentation.ContributingAll contributions, starting with feedbacks, are welcomed.
Please readCONTRIBUTING.mdif you wish to contribute to the project.LicenseThis library is licensed under LGPL V3 license. See theLICENSEfile for details.It is mainly intended for non-commercial use, by academics, students or professional willing to learn the basics of side-channel analysis.If you wish to use this library in a commercial or industrial context, eshard provides commercial licenses under fees. Contact us!AuthorsSeeAUTHORSfor the list of contributors to the project.
Package: estrade
EstradeBacktest and run your trading strategiesEstrade is a python library that allows you to easily backtest and run stock trading strategies at tick level.Estrade focus on providing tools so you mainly focus on your strategy definition.WARNING: Estrade is still in an alpha state of developpement and very unmature. Do not use it for other purposes than testing.FeaturesEstrade provides amarket environnement, so you do not have to worry aboutTrades result calculationIndicators building & calculation (candle sets, graph indicators etc.)Estrade is build to be extended so you can define your own:StrategiesTick provider (to feed your backtests and/or live trading)IndicatorsReportingWhat Estrade does NOT providesData: You have to define your own data provider (live or static)Strategies: Although some very basic (and useless) strategies are provided as examples in samples, Estrade does not provide any financially relevant strategy.DocumentationDocumentation
Package: estreamer
=========eStreamer=========SourceFire eStreamer python client libraryUsage^^^^^See the `examples/ <https://github.com/spohara79/estreamer/examples>`_ directory for an example clientYou need the following:- Configure SourceFire for the client authentication using this: `http://www.cisco.com/c/en/us/td/docs/security/firesight/540/api/estreamer/EventStreamerIntegrationGuide/ConfiguringEstreamer.html#38601 <http://www.cisco.com/c/en/us/td/docs/security/firesight/540/api/estreamer/EventStreamerIntegrationGuide/ConfiguringEstreamer.html#38601>`_- Get the SourceFire server certificate (for TLS verification)Plugins^^^^^^^The plugin system uses an autoload and auto-unload mechanism in order to add or remove plugins without needing to restart.  Simply drop a plugin into the plugins/ directory and it will pick it up and register (and use it).  Conversely, remove the plugin from the directory and it will unregister the plugin (and not use it)To create plugins, you will need to inherit the **Plugin** class.  In addition, you will need to create a class variable (dictionary) named **__info__** that contains:- **description**: description of the plugin- **author**: name of the author (and optionally contact, etc.)- **version**: version of the plugin- **callback**: the string name of the callback method (the function to be called in your plugin to do its thing)The callback function will receive each *record* (alert that is processed)Example:::from plugin import Pluginclass YourPlugin(Plugin):__info__ = {'description': 'my plugin','author'     : 'my name','version'    : '0.1','callback'   : 'my_function',}def my_function(self, record):print(record)
Package: estruttura
OverviewAbstract data structures.Motivationestrutturawas born out of the need for a similar interface between thedattaandobjettopackages.Relationshipestrutturaprovides aRelationshipclass that contains information about the values stored in theStructures,
such as typing (with support for runtime type checking), serialization, validation, conversion, etc.>>>fromsiximportstring_types>>>fromestrutturaimportRelationship,exceptions>>>defconverter(value):...ifisinstance(value,string_types)and"."invalue:...returnfloat(value)...elifnotisinstance(value,float):...returnint(value)...>>>defvalidator(value):...ifvalue>10:...raiseexceptions.ValidationError(value)...>>>relationship=Relationship(types=(int,float),converter=converter,validator=validator)>>>relationship.process_value("3.3")3.3Structuresestrutturaoffers all the class combinations of the concepts described below.Private StructureHolds data internally and only allow for changes privately.User StructureAllows for changing of the data by external clients (public).Immutable StructureOnly allows data changes through copying.
Immutable structures are hashable.>>>fromestruttura.examplesimportImmutableList>>>l_a=ImmutableList()>>>l_b=l_a.extend(range(3))>>>list(l_b)==[0,1,2]TrueMutable StructureAllows in-place data changes.
Mutable structures are not hashable.>>>fromestruttura.examplesimportMutableList>>>l=MutableList()>>>l.extend(range(3))>>>list(l)==[0,1,2]TrueDict StructureDictionary-like data structure class.>>>fromestrutturaimportRelationship>>>fromestruttura.examplesimportMutableDict>>>classStrIntDict(MutableDict):...relationship=Relationship(converter=str)...value_relationship=Relationship(converter=int)...>>>StrIntDict({1:"1"})StrIntDict({'1':1})List StructureList-like data structure class.>>>fromestrutturaimportRelationship>>>fromestruttura.examplesimportMutableList>>>classIntList(MutableList):...relationship=Relationship(converter=int)...>>>IntList(["1",1,1.0])IntList([1,1,1])Set StructureSet-like data structure class.>>>fromestrutturaimportRelationship>>>fromestruttura.examplesimportMutableSet>>>classIntSet(MutableSet):...relationship=Relationship(converter=int)...>>>IntSet({"1",1,1.0})IntSet({1})StructureDataclass-like structure class that has a schema defined by attributes.>>>importmath>>>fromestrutturaimportAttribute,Relationship,getter>>>fromestruttura.examplesimportImmutableClass>>>classPoint(ImmutableClass):...x=Attribute()...y=Attribute()...d=Attribute(serializable=True,repr=True)...@getter(d,dependencies=(x,y))...def_(self):...returnmath.sqrt(self.x**2+self.y**2)...>>>Point(3,4)Point(3,4,<d=5.0>)>>>Point(3,4).serialize()=={"x":3,"y":4,"d":5.0}True>>>Point.deserialize({"x":3,"y":4})Point(3,4,<d=5.0>)
Package: estrutura-de-dados
estrutura_de_dadosArquivos para Estrutura de Dados: Fila, Pilha e Lista.InstallationUse the package manager pip to install estrutura_de_dados
pip install estrutura_de_dadosUsagefrom estrutura_de_dados import fila
from estrutura_de_dados import pilha
from estrutura_de_dados import listaAuthorRafael Pacheco
dev-rafa1707
Package: estuary-airbyte-cdk
Connector Development Kit (Python)The Airbyte Python CDK is a framework for rapidly developing production-grade Airbyte connectors. The CDK currently offers helpers specific for creating Airbyte source connectors for:HTTP APIs (REST APIs, GraphQL, etc..)Singer TapsGeneric Python sources (anything not covered by the above)The CDK provides an improved developer experience by providing basic implementation structure and abstracting away low-level glue boilerplate.This document is a general introduction to the CDK. Readers should have basic familiarity with theAirbyte Specificationbefore proceeding.Getting StartedGenerate an empty connector using the code generator. First clone the Airbyte repository then from the repository root runcd airbyte-integrations/connector-templates/generator
./generate.shthen follow the interactive prompt. Next, find allTODOs in the generated project directory -- they're accompanied by lots of comments explaining what you'll need to do in order to implement your connector. Upon completing all TODOs properly, you should have a functioning connector.Additionally, you can followthis tutorialfor a complete walkthrough of creating an HTTP connector using the Airbyte CDK.Concepts & DocumentationSee theconcepts docsfor a tour through what the API offers.Example ConnectorsHTTP Connectors:Exchangerates APIStripeSlackSinger connectors:SalesforceGithubSimple Python connectors using the barebonesSourceabstraction:Google SheetsMailchimpContributingFirst time setupWe assumepythonpoints to python >=3.9.Setup a virtual env:python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]" # [dev] installs development-only dependenciesIterationIterate on the code locallyRun tests viapytest -s unit_testsPerform static type checks usingmypy airbyte_cdk.MyPyconfiguration is in.mypy.ini.Thetype_check_and_test.shscript bundles both type checking and testing in one convenient command. Feel free to use it!TestingAll tests are located in theunit_testsdirectory. Runpytest --cov=airbyte_cdk unit_tests/to run them. This also presents a test coverage report.Publishing a new version to PyPiBump the package version insetup.pyOpen a PRAn Airbyte member must comment/publish-cdk dry-run=trueto publish the package to test.pypi.org or/publish-cdk dry-run=falseto publish it to the real index of pypi.org.Coming SoonFull OAuth 2.0 support (including refresh token issuing flow via UI or CLI)Airbyte Java HTTP CDKCDK for Async HTTP endpoints (request-poll-wait style endpoints)CDK for other protocolsDon't see a feature you need?Create an issue and let us know how we can help!
Package: esu
Welcome to Esu Struct!Enjoy the flexibility of structs withesu!You can create types on the fly with previously declared fields and methods by usingesu struct.The created type additionally contains methods for equation, hashing and string representation.InstallpipinstallesuUsageStructfromesuimportStruct,OpenStructCustomer=Struct('Customer','name','age',methods={'greeting':lambdaself:"Hello{}".format(self.__dict__['name'])})dave=Customer()dave.name='Dave'dave.age=25dave.greeting()# => Hello Daveanna=Customer('Anna',28)anna.greeting()# => Hello AnnaOpenStructbob=OpenStruct()bob.name=Bobbob.age=54print(bob)# => [name=Bob, age=54]su=OpenStruct({'name':'Su','gender':'female'})su.employed=Trueprint(su)# => [name=Su, gender=female, employed=True]DocumentationFor further information, read the documentation that can be found:https://esu.readthedocs.ioContributionFork it!Make your changes!Send a PR!
Package: esub
# esub python client libraryesub is a super lightweight micro message passing service,
this is a python client library to connect to an esub nodefor more details about esub, see its repo:https://github.com/ccpgames/esub## examples# subscribing`python # this will block until fulfilled or canceledprint(esub.sub("some_key",token="secret"))`# replying`python # also blocking, but should be a fast responseesub.rep("some_key","some data",token="secret")`
Package: esub-epipe
esub-epipeesub-epipe is part of the Non-Gaussian Statistics Framework
(NGSF).If you use this package in your research please cite (Zuercher et al.
2020,arXiv-2006.12506), (Zuercher
et al. 2021,arXiv-2110.10135) and
(Zuercher et al. 2022,arXiv-2206.01450).SourceDocumentationIntroductionAre you tired of rewriting the same kind of submission scripts to
sumbit your code to a computer cluster?Do you not want to rewrite different versions of your code for
serial, parallel or MPI execution, but instead use the same
executable everytime?Do you wish there would be an easy way to submit large numbers of
dependent jobs to a computer cluster without writing the same kind
of pipeline scripts and worrying about resource allocation every
time?If any of these points applies to you, you have come to the right place
:)When using this package you will only need to write a single python
executable file. The same file can then be used to run your code
serially, in parallel or in an MPI environement on your local machine.
You can also use the same file to submit your code to a computer cluster
that runs IBMs LSF system or SLURM (experimental).Even more, if you are building large pipelines with many dependent jobs,
or even tasks which have to be executed multiple times you will just
have to write a single YAML file in which you state what you want to run
and esub will submit all those jobs to the computer cluster such that
you can continue working on your amazing projects while waiting for the
results :)Getting StartedThe easiest and fastest way to learn about esub is to have a look at the
Examples Section in the documentation. If you wish to learn more also
have a look at the Usage Section in the documenation in which we
documented all the things you can do with esub.DisclaimerAt the moment only IBMs bsub and slurm systems is supported but we hope to include
other queing systems in the future.CreditsThis package was created on May 12 2019 by Dominik Zuercher (PhD student
at ETH Zurich in Alexandre RefregiersCosmology Research
Group). It is inspired by the jobchainer
code written by Tomasz Kacprzak.The package is maintained by Silvan Fischbachersilvanf@phys.ethz.ch.ContributingContributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.
Package: esupar
esuparTokenizer, POS-tagger, and dependency-parser withTransformersandSuPar.Basic usage>>>importesupar>>>nlp=esupar.load("ja")>>>doc=nlp("太郎は花子が読んでいる本を次郎に渡した")>>>print(doc)1太郎_PROPN__12nsubj_SpaceAfter=No2は_ADP__1case_SpaceAfter=No3花子_PROPN__5nsubj_SpaceAfter=No4が_ADP__3case_SpaceAfter=No5読ん_VERB__8acl_SpaceAfter=No6で_SCONJ__5mark_SpaceAfter=No7いる_AUX__5aux_SpaceAfter=No8本_NOUN__12obj_SpaceAfter=No9を_ADP__8case_SpaceAfter=No10次郎_PROPN__12obl_SpaceAfter=No11に_ADP__10case_SpaceAfter=No12渡し_VERB__0root_SpaceAfter=No13た_AUX__12aux__>>>importdeplacy>>>deplacy.render(doc,Japanese=True)太郎PROPN═╗<════════╗nsubj(主語)はADP<╝║case(格表示)花子PROPN═╗<══╗║nsubj(主語)がADP<╝║║case(格表示)読んVERB═╗═╗═╝<╗║acl(連体修飾節)でSCONJ<╝║║║mark(標識)いるAUX<══╝║║aux(動詞補助成分)本NOUN═╗═════╝<╗║obj(目的語)をADP<╝║║case(格表示)次郎PROPN═╗<╗║║obl(斜格補語)にADP<╝║║║case(格表示)渡しVERB═╗═╝═════╝═╝root(親)たAUX<╝aux(動詞補助成分)esupar.load(model)loads a natural language processor pipeline, working onUniversal Dependencies. Availablemodeloptions are:model="ja"Japanese modelbert-base-japanese-upos(default)model="ja_large"Japanese modelbert-large-japanese-uposmodel="ja_luw_small"Japanese long-unit-word modelroberta-small-japanese-char-luw-uposmodel="ja_luw_base"Japanese long-unit-word modelbert-base-japanese-luw-uposmodel="ja_luw_large"Japanese long-unit-word modelbert-large-japanese-luw-uposmodel="ko"Korean modelroberta-base-korean-uposmodel="ko_large"Korean modelroberta-large-korean-uposmodel="ko_morph_base"Korean morpheme modelroberta-base-korean-morph-uposmodel="ko_morph_large"Korean morpheme modelroberta-large-korean-morph-uposmodel="zh"Chinese modelchinese-bert-wwm-ext-uposmodel="zh_base"Chinese modelchinese-roberta-base-uposmodel="zh_large"Chinese modelchinese-roberta-large-uposmodel="lzh"Classical Chinese modelroberta-classical-chinese-base-uposmodel="lzh_large"Classical Chinese modelroberta-classical-chinese-large-uposmodel="th"Thai modelroberta-base-thai-spm-uposmodel="vi"Vietnamese modelbert-base-vietnamese-uposmodel="en"English modelroberta-base-english-uposmodel="en_large"English modelroberta-large-english-uposmodel="de"German modelbert-base-german-uposmodel="de_large"German modelbert-large-german-uposmodel="sr"Serbian (Cyrillic and Latin) modelroberta-base-serbian-uposmodel="cop"Coptic modelroberta-base-coptic-uposmodel="ain"Ainu modelroberta-base-ainu-uposInstallation for Linuxpip3installesupar--userInstallation for Cygwin64Make sure to getpython37-develpython37-pippython37-cythonpython37-numpypython37-wheelgcc-g++mingw64-x86_64-gcc-g++gitcurlmakecmake, and then:curl-Lhttps://raw.githubusercontent.com/KoichiYasuoka/CygTorch/master/installer/supar.sh|sh
pip3.7installesuparInstallation for Google Colaboratory!pipinstallesuparTrynotebook.AuthorKoichi Yasuoka (安岡孝一)
Package: esx
esxJS API in python 3!Contains• js API in python 3(A downsteam of the domonic js API)APIfromesx.javascriptimportMathprint(Math.random())fromesx.javascriptimportArraymyArr=Array(1,2,3)print(myArr.splice(1))fromesx.javascriptimportURLurl=URL('https://somesite.com/blog/article-one#some-hash')print(url.protocol)print(url.host)print(url.pathname)print(url.hash)# you can use Global class to import all the js methods from the global namespace i.e# from esx.javascript.esx import Global# Global.decodeURIComponent(...# Global.encodeComponent(...# Global.setInterval(...# from esx.javascript.esx import Date, String, Number# etc..You can use setInterval and clearInterval with paramsfromesx.javascriptimportsetInterval,clearIntervalx=0defhi(inc):globalxx=x+incprint(x)test=setInterval(hi,1000,2)importtimetime.sleep(5)clearInterval(test)print(f"Final value of x:{x}")Or for a single delayed function call use setTimeout, clearTimeoutfromesx.javascriptimportsetTimeout,clearTimeouttimeoutID=setTimeout(hi,1000)DOCShttps://esx.readthedocs.io/notescurrently forking over from domonic.Join-InFeel free to contribute if you find it useful.Email me, message me directly if you like or create a discussion on here.If there are any methods you want that are missing or not complete yet or you think you can help make it better just update the code and send a pull request.I'll merge and releaese asap.run testsThere are tests used during dev. They are useful as code examples and to see what still needs doing.See Makefile to run all tests:maketestor to test a single function:python-munittesttests.test_esx.TestCase.test_esx_arrayor to test a whole modulepython-munittesttests.test_esxto see coveragecoveragerun-munittestdiscovertests/
coveragereport
Package: es-xlsx2csv
xlsx2csvCommand line utility to convert xlsx file to csvHeavily based offCaleb Dinsmore'scommand line utilitymatillion-columns.How to RunBefore you do anything, make sure you've followedthis play.Installationbrewinstallpython2
pipinstall--useres-xlsx2csvRunOnce you've followed these steps, you should be able to run the script, using (it may take a few seconds to run, depending on the size of the file):es-xlsx2csv [OPTIONS] csv_file.csvFor more help info, run:es-xlsx2csv -h
Package: esxport
EsXportAn adept Python CLI utility designed for querying Elasticsearch and exporting result as a CSV file.RequirementsThis tool should be used with Elasticsearch 8.x version.You also need >=Python 3.8.x.InstallationFrom source:pipinstallgit+https://github.com/nikhilbadyal/esxport.gitUsageesxport--helpArgumentsOptions:
  -q, --query JSON                Query string in Query DSL syntax.
                                  [required]
  -o, --output-file PATH          CSV file location.  [required]
  -i, --index-prefixes TEXT       Index name prefix(es).  [required]
  -u, --url URL                   Elasticsearch host URL.  [default:
                                  https://localhost:9200]
  -U, --user TEXT                 Elasticsearch basic authentication user.
                                  [default: elastic]
  -p, --password TEXT             Elasticsearch basic authentication password.
                                  [required]
  -f, --fields TEXT               List of _source fields to present be in
                                  output.  [default: _all]
  -S, --sort ELASTIC SORT         List of fields to sort on in form
                                  <field>:<direction>
  -d, --delimiter TEXT            Delimiter to use in CSV file.  [default: ,]
  -m, --max-results INTEGER       Maximum number of results to return.
                                  [default: 10]
  -s, --scroll-size INTEGER       Scroll size for each batch of results.
                                  [default: 100]
  -e, --meta-fields [_id|_index|_score]
                                  Add meta-fields in output.
  --verify-certs                  Verify SSL certificates.
  --ca-certs PATH                 Location of CA bundle.
  --client-cert PATH              Location of Client Auth cert.
  --client-key PATH               Location of Client Cert Key.
  -v, --version                   Show version and exit.
  --debug                         Debug mode on.
  --help                          Show this message and exit.