Saravanan666/pypi-org huggingface dataset:
Package: ext_pylib
extra python modules for server script scaffoldingThis is a work in progress. Use at your own risk.ext_pylib is a group of submodules that are useful scaffolding for other larger
projects. I began developing it after noticing how often I was repeating
several patterns for server scripts. It works well for building server scripts.Installing and Including in projectsInstalling ext_pylib$gitclonegit@github.com:hbradleyiii/ext_pylib.git$cd<projectdirectory>$pipinstall-e.Running Tests$cd<projectdirectory>$py.testModulesDomain ModuleTODOFiles ModuleA class to manage and create files. Also includes three
mixin classes Parsable, Section, and Template.Section MixinThe Section mixin adds methods useful for processing
template section files. A section file is a template of a
configuration file that only represents a particular
section of that file. It begins and ends with a delineatorFor example:## START:SECTION_NAME ##contenthere...## END:SECTION_NAME ##A use case would be how WordPress
delineates a particular section of the htaccess file in its
root directory with a start line and an end line. This is a
section of the full htaccess file and could be managed by a
Section mixin.Template MixinThe Template mixin adds a method useful for processing a
regular template file:apply_using(). It assumes that the
file contains placeholder text to be replaced by actual
data. The placeholders and actual data are passsed into the
method as a dict. The resulting data is returned
(presumably to be saved in another file.)
#### Parsable MixinThe Parsable mixin adds a method useful for parsing
(presumably) configuration files. It takes a dict of
attribute names and regexes to be used. Whensetup_parsing()is called, a dynamic property is created
for getting and setting a value in self.data based on the
regex.Password ModuleTODOPrompt ModuleTODOUser ModuleTODOSoli Deo gloria.
Package: extquerysets
ExtendedQuerySetsExtendedQuerySets is meant to simplify the way to retrieveoneobject from db using Django QuerySets.Installation:$ pip install extquerysetsExamples:For the following examples assume that we have a modelPlayer, and we've implemented custom Manager and QuerySet for that model.Task 1:Retrieve one object or return None if object doesn't exist.Usual way:try:winner=Player.objects.winner()exceptPlayer.DoesNotExist:winner=NoneUsing ExtendedQuerySets:winner=Player.objects.winner_or_none()Task 2:Retrieve one object or raise Http404 if object doesn't exist.Usual way:try:winner=Player.objects.winner()exceptPlayer.DoesNotExist:raiseHttp404Using ExtendedQuerySets:winner=Player.objects.winner_or_404()Usage:models.pyfromdjango.dbimportmodelsfrom.querysetsimportPlayerQuerySetclassPlayer(model.Model):name=models.CharField(_('Name'),max_length=12)is_winner=models.BooleanField(_('Is winner'),default=False)objects=PlayerQuerySet.as_manager()querysets.pyfromextquerysets.baseimportCustomQuerySetfromextquerysets.decoratorsimportor_404fromextquerysets.decoratorsimportor_noneclassPlayerQuerySet(CustomQuerySet):@or_404@or_nonedefget(self,*args,**kwargs):returnsuper().get(*args,**kwargs)@or_404@or_nonedefwinner(self):returnself.get(is_winner=True)Now you can retrieve Player instance:from.modelsimportPlayer...player=Player.objects.winner_or_none()player=Player.objects.winner_or_404()player=Player.objects.filter(name__icontains='Tom').winner_or_none()player=Player.objects.filter(name__icontains='Tom').winner_or_404()player=Player.objects.get_or_none(pk=10)player=Player.objects.get_or_404(pk=10)...More info about custom Managers and QuerySets:https://docs.djangoproject.com/en/2.0/topics/db/managers/
Package: extr
ExtrNamed Entity Recognition (NER) and Relation Extraction (RE) library using Regular ExpressionsInstallpip install extrExampletext='Ted is a Pitcher.'1. Entity ExtractionFind Named Entities from text.fromextrimportRegEx,RegExLabelfromextr.entitiesimportEntityExtractorentity_extractor=EntityExtractor([RegExLabel('PERSON',[RegEx([r'ted'],re.IGNORECASE)]),RegExLabel('POSITION',[RegEx([r'pitcher'],re.IGNORECASE)]),])entities=entity_extractor.get_entities(text)## entities == [##      <Entity label="POSITION" text="Pitcher" span=(9, 16)>,##      <Entity label="PERSON" text="Ted" span=(0, 3)>## ]or add a knowledge basefromextrimportRegEx,RegExLabelfromextr.entitiesimportcreate_entity_extractorentity_extractor=create_entity_extractor([RegExLabel('POSITION',[RegEx([r'pitcher'],re.IGNORECASE)]),],kb={'PERSON':['Ted']})entities=entity_extractor.get_entities(text)## entities == [##      <Entity label="POSITION" text="Pitcher" span=(9, 16)>,##      <Entity label="PERSON" text="Ted" span=(0, 3)>## ]2. Visualize Entities in HTMLAnnotate text to display in HTML.fromextr.entities.viewersimportHtmlViewerviewer=HtmlViewer()viewer.append(text,entities)html=viewer.create_view(custom_styles=""".lb-PERSON {background-color: orange;}.lb-POSITION {background-color: yellow;}""")3. Relation ExtractionAnnotate and Extract Relationships between Entitiesfromextr.entitiesimportEntityAnnotatorfromextr.relationsimportRelationExtractor,\RegExRelationLabelBuilder## define relationship between PERSON and POSITIONrelationship=RegExRelationLabelBuilder('is_a')\.add_e1_to_e2('PERSON',## e1[## define how the relationship exists in naturer'\s+is\s+a\s+',],'POSITION'## e2)\.build()relations_to_extract=[relationship]## `entities` see 'Entity Extraction' aboveannotated_text=EntityAnnotator().annotate(text,entities)relations=RelationExtractor(relations_to_extract).extract(annotated_text,entities)## relations == [##      <Relation e1="Ted" r="is_a" e2="Pitcher">## ]
Package: extrabol
extrabolextrabolis a Python 3.x package for rapidly and systematicaly estimating the bolometric luminosity and black body properties of (thermal) extragalactic transients from broadband UVONIR data.extrabolis broken down into three main steps:Read in and pre-process a data file holding observations of a supernova or other transient event over time, through any number of broadband filters.Interpolate this data using a Gaussian Process(GP), a non-physical, statistical model utilizing covariance.Fit a series of blackbody curves to the interpolated data to estimate the bolometric luminosity, temperature, and radius of the transient over time.Author: Ian ThorntonInstallation and DocumentationInstall with pip:pipinstallextrabolThe latest documentation is availablehere.Usageextrabol 'filename.dat' ARGUMENTSOptional Arguments:--verbose
    Increase output verbosity

-m MEAN, --mean MEAN
    Use a supernova template as the mean function for the GP; Choose \'1a\',\'1bc\', \'2l\', \'2p\', or \'0\' (for no template)
    Default = 0

-t, --show-template
    Shows supernova template on plots as dotted lines

-d DIST, --dist DIST
    Object luminosity distance in Mpc

-z REDSHIFT, --redshift REDSHIFT
    Object redshift
    If no argument is provided, redshift will be read from the input file

--dm DM
    Object distance modulus

--plot BOOL
    Output plots, Default is TRUE

--outdir OUTDIR
    A file location for outputs to be written to

--ebv EBV
    Milky Way extinction E(B-V) value, if known
    If no argument is probided the extinction will be read from the input file

--hostebv HOSTEBV
    Host extinction E(B-V)

-s START, --start START
    Start time of analysis window relative to peak luminosity
    Default = -50 days

-e END, --end END
    End time of analysis window relative to peak luminosity
    Default = 150 days

-snr SNR
    Minimum signal to noise ratio for observations
    Default = 4.0

-wc, --wvcorr
    Use the redshift-corrected wavelength values for extinction calculations

-mc, --use-mcmc
    Use a Markov Chain Monte Carlo to fit black bodies instead of curve_fit.
    This provides better error estimates but takes much longer.

--T_max T_MAX
    Modify the prior on temperature for blackbody fits by specifying a maximum temperature.
    Default = 40,000KInput FilesInputs to extrabol must be .dat files that conform to the following format.The first two lines must contain redshift and Milky Way extinction E(b-v) respectively. If these values are unknown, simply put 0.0.
The following lines contain observational data in 5 columns as shown below:Time(MJD)   Apparent Magnitude   Error(in magnitudes)   Filter SVO ID   Type of magnitude (AB or Vega)Any white space can be used as the column delimiter. NaNs, non-detections, and data points with no error bars should not be included.
An example input file can be found under extrabol/example.Example Inputextrabol./example/PSc000174_extrabol.dat--verbose-m1aThis example may take a minute the first time you run it as astroquery fetches filter information!Filters must be specified by theirSVOID.
Package: extra-boolean
Booleandata type has two possible truth values to represent logic.📦PyPi,
📰Pdoc,
📘Wiki.Here is my implementation of digital logic gates in software. That includes
the basic gatesnot_,and_,or_,xor; their complementsnand,nor,xnor; and 2 propositional logic (taught in discrete mathematics) gatesimply,eq; and their complementsnimply,neq. There is also a
multiplexer, calledselect, and aTruecounter, calledcount.countcan help you make custom gates, such as analternateconcept ofxnorwhich returnsTrueonly if all inputs are the same (standardxnorreturnsTrueif even inputs areTrue). All of them can handle upto 8 inputs.parseis influenced by"boolean"package, and is quite good at translatingstrtobool. It can also handle double negatives, eg.not inactive.
You know theand_of 2-inputs, but what of 1-input? What of 0? And what of
the other gates? I answer them here.Stability: Experimental.fromextra_booleanimport*parse("1")parse("truthy")parse("Not Off")parse("Not Inactive")# Trueparse("cold")parse("inactive")parse("Negative Yes")parse("Negative Aye")# Falseimply(True,False)# Falseeq(False,False)# Truexor(True,True,True)# Trueselect(1,True,False,True)# False           ^count(True,False,True)# 2    ^            ^IndexFunctionActionparseConverts string to boolean.not_Checks if value is false.and_Checks if all values are true.or_Checks if any value is true.xorChecks if odd no. of values are true.nandChecks if any value is false.norChecks if all values are false.xnorChecks if even no. of values are true.eqChecks if antecedent ⇔ consequent (a ⇔ b).neqChecks if antecedent ⇎ consequent (a ⇎ b).implyChecks if antecedent ⇒ consequent (a ⇒ b).nimplyChecks if antecedent ⇏ consequent (a ⇏ b).selectChecks if ith value is true.countCounts no. of true values.ReferencesHow to Build Your Very First Python PackageTest Python package publishing with the Test Python Package IndexHow to use setup.py to install dependencies only?install_requires vs requirements filesWhat does the “-U” option stand for in pip install -UGetting Started With Testing in PythonImport parent directory for brief testspytest: Most useful command-line optionsHow to do relative imports in Python?How do I use a keyword as a variable name?pdoc: Auto-generate API documentation for Python projectsDocstrings in PythonPEP 257 -- Docstring ConventionsPEP 8 -- Style Guide for Python CodeTwine is asking for my password each time : how to use the .pypircTravisCI: Building Pull RequestsTravisCI: Building a Python ProjectCreating a clean gh-pages branchHow to show only next line after the matched one?How To Check If a Directory Exists In a Shell ScriptHow do I trim leading and trailing whitespace from each line of some output?Bash if..else Statement
Package: extra-cereb-nest
extra_cereb_nestpip installable NEST extension module, generated by pipnest.Installation instructionsUsing pipWhen installed through pip the module is built for you with CMake outside of the python
package folder, this means that pip cannot track the real installation status. To
uninstall and reinstall seeUninstallation.Install NEST following the instructions provided here (https://www.nest-simulator.org/)Install using pippip install extra_cereb_nest --no-cache-dirLoad the module after importing nest:import nest
nest.Install("extracerebmodule")UninstallationTo uninstall this module usepip uninstall extra_cereb_nestand remove the(lib)extracerebmodule.sofiles from thelib/nest/directory in your nest installation.
Package: extra-context
extra-contextSometimes, when you get warnings and exeptions, backtraces are just not enough.
For example, you have a loop with 10.000 iterations. In the 1000th iteration there is an
exception in a function you called. So you would like to have more context for the error message.There are 2 optionsgive more context at the site the exception occuredOnly possible if you control the exception/warning generationSometimes, there is not enough context to begin with (i.e. you are calling some common utility function)Provide additional context as the exception/warning is passed up the call stackCan be "opt-in" in user-code, no changes in libraries required.Also works for warnings (which normally don't provide backtrace information)ExamplesThe main example that inspired writing this library:to_process={"file1":{...},"file2":{...},...}fork,vinto_process.items():cleaned=clean_data(v)write_output(k,cleaned)If there is an exception or warning somewhere inclean_data(v), the "context" i.e. from which
file the data came is lost. The backtrace could look something like:File "clean.py", line 35, in clean_data
ZeroDivisionError: division by zeroNow, with this library you can give extra context to your error messagesfromextra_contextimportprovide_extra_contextto_process={"file1":{...},"file2":{...},...}fork,vinto_process.items():withprovide_extra_context(filename=k):cleaned=clean_data(v)write_output(k,cleaned)This would report the same error as:File "clean.py", line 35, in clean_data
ZeroDivisionError: division by zero
  |- In context: filename='file4'DecoratorThere is also a decorator that reports the function arguments in case of an errorimportwarningsfromextra_contextimportprovide_call_context@provide_call_contextdefw(x):warnings.warn("Oops")w(42)This reports:UserWarning: Oops
  |- In context: w(42)
  warnings.warn("Oops")LicenseCopyright 2018 Moritz WanzenböckPermission 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.
Package: extract-6a6f6a6f
Lazy Android App ExtractionUm jeito preguiçoso e que funciona, para fazer opullde uma aplicação Android qualquer.Sem problemasquando tiver mais de umdevicelistável viaadb;Funciona em qualquer OS, desde que você tenha oadbem seu$PATH;Vocênão precisa saber ou digitar todo opackage name, basta alguma coisa; eViapip,sem dor de cabeça com depêndencias, é somente umwrapperdoadb.No jeito mais simples, basta instalar viapipe já sair utilizando:$pip3installextract-6a6f6a6f
Package: extractacy
spaCy 3.0 support coming soonextractacy - pattern extraction and named entity linking for spaCyspaCy pipeline object for extracting values that correspond to a named entity (e.g., birth dates, account numbers, or laboratory results)Installation and usageInstall the library.pipinstallextractacyImport library and spaCy.importspacyfromspacy.pipelineimportEntityRulerfromextractacy.extractimportValueExtractorLoad spacy language model. Set up an EntityRuler for the example.nlp=spacy.load("en_core_web_sm")# Set up entity rulerruler=nlp.add_pipe("entity_ruler")patterns=[{"label":"TEMP_READING","pattern":[{"LOWER":"temperature"}]},{"label":"TEMP_READING","pattern":[{"LOWER":"temp"}]},{"label":"DISCHARGE_DATE","pattern":[{"LOWER":"discharge"},{"LOWER":"date"}],},]ruler.add_patterns(patterns)Define which entities you would like to link patterns to. Each entity needs 3 things:patterns to search for (list). This relies onspaCy token matching syntax.n_tokens to search around a named entity (intorsent)direction (right,left,both)# Define ent_patterns for value extractionent_patterns={"DISCHARGE_DATE":{"patterns":[[{"SHAPE":"dd/dd/dddd"}],[{"SHAPE":"dd/d/dddd"}]],"n":2,"direction":"right"},"TEMP_READING":{"patterns":[[{"LIKE_NUM":True},{"LOWER":{"IN":["f","c","farenheit","celcius","centigrade","degrees"]}},]],"n":"sent","direction":"both"},}Add ValueExtractor to spaCy processing pipelinenlp.add_pipe("valext",config={"ent_patterns":ent_patterns},last=True)doc=nlp("Discharge Date: 11/15/2008. Patient had temp reading of 102.6 degrees.")foreindoc.ents:ife._.value_extract:print(e.text,e.label_,e._.value_extract)## Discharge Date DISCHARGE_DATE 11/15/2008## temp reading TEMP_READING 102.6 degreesContributingcontributingAuthorsJeno PizarroLicenselicense
Package: extract-bib
extract_bibA small utility that usesBibToolto extract only the works cited in a Pandoc Markdown file from a BibTeX file.If your workflow involves writing in Markdown and converting that Markdown to TeX with Pandoc, and you keep a large bibliography in a single BibTeX file, this utility will allow you to extract only the works cited in the Markdown file into a separate BibTeX file for distribution/portability.It is intended as part of a transparent, plain text academic workflow.It is based onthis ruby Gist.Installationpipinstallextract_bibUsageTo extract the references ingreat_paper.mdthat you keep in your~/Documents/references.biband place them ingreat_paper.bib, run:extract_bib--bibtex-file~/Documents/references.bibgreat_paper.mdgreat_paper.bib
Package: extractCMRRPhysio
CMRR-MB in Pythonrewrite Matlab's extractCMRRPhysio.m(https://github.com/CMRR-C2P/MB/blob/master/extractCMRRPhysio.m) in Python',install:pipinstallgit+https://github.com/yinglilu/extractCMRRPhysio.git#egg=extractCMRRPhysioorpipinstallextractCMRRPhysiousage:extractCMRRPhysio/path/to/dicom_file/output_path
Package: extract-codon-alignment
extract-codon-alignment1 Introductionextract-codon-alignment(https://github.com/linzhi2013/extract_codon_alignment) is a tool to extract some codon positions (1st, 2nd, 3rd) from a CDS alignment withBiopython(http://www.biopython.org/)2 Installation$ pip install extract-codon-alignment
# or with Bioconda
conda install extract-codon-alignmentThere will be a commandextract_codon_alignmentcreated under the same directory as yourpipcommand.3 Usage$ extract_codon_alignment
usage: extract_codon_alignment [-h] --alignedCDS <file>
                               [--aln_format <format>]
                               [--codonPoses {1,2,3,12,13,23}] --outAln <file>

To extract some codon positions (1st, 2nd, 3rd) from a CDS alignment.

optional arguments:
  -h, --help            show this help message and exit
  --alignedCDS <file>   The CDS alignment.
  --aln_format <format>
                        the file format for the CDS alignment. Anything
                        accepted by BioPython is fine [fasta]
  --codonPoses {1,2,3,12,13,23}
                        Codon position(s) to be extracted [12]
  --outAln <file>       output file nameAuthorGuanliang MENGCitationCurrently I have no plan to publishextract-codon-alignment.However, sinceextract-codon-alignmentmakes use ofBiopython, you should cite it if you useextract-codon-alignmentin your work:Peter J. A. Cock, Tiago Antao, Jeffrey T. Chang, Brad A. Chapman, Cymon J. Cox, Andrew Dalke, Iddo Friedberg, Thomas Hamelryck, Frank Kauff, Bartek Wilczynski, Michiel J. L. de Hoon: “Biopython: freely available Python tools for computational molecular biology and bioinformatics”. Bioinformatics 25 (11), 1422–1423 (2009). https://doi.org/10.1093/bioinformatics/btp163Please go tohttp://www.biopython.org/for more details.
Package: extractcontent3
ExtractContent3===============.. image:: https://img.shields.io/badge/License-BSD%202--Clause-orange.svg:target: https://opensource.org/licenses/BSD-2-Clause.. image:: https://img.shields.io/badge/python-3.6-blue.svg.. image:: https://travis-ci.org/kanjirz50/python-extractcontent3.svg?branch=master:target: https://travis-ci.org/kanjirz50/python-extractcontent3ExtractContent3はPython3で動作する、HTMLから本文を抽出するモジュールです。このモジュールは、ExtractContent RubyモジュールをPython用に書き直したpython-extracontentを改造したものです。Usage------------.. code-block:: pythonfrom extractcontent3 import ExtractContentextractor = ExtractContent()# オプション値を指定するopt = {"threshold":50}extractor.set_default(opt)html = open("index.html").read() # 解析対象HTMLextractor.analyse(html)text, title = extractor.as_text()html, title = extractor.as_html()title = extractor.extract_title(html)Installation------------.. code-block:: bash# pypi$ pip install extractcontent3# Githubからのインストール$ pip install git+https://github.com/kanjirz50/python-extractcontent3Option-------------.. code-block:: python"""オプションの種類:名称 / デフォルト値threshold / 100本文と見なすスコアの閾値min_length / 80評価を行うブロック長の最小値decay_factor / 0.73減衰係数小さいほど先頭に近いブロックのスコアが高くなりますcontinuous_factor / 1.62連続ブロック係数大きいほどブロックを連続と判定しにくくなるpunctuation_weight / 10句読点に対するスコア大きいほど句読点が存在するブロックを本文と判定しやすくなるpunctuations r"(?is)([\u3001\u3002\uff01\uff0c\uff0e\uff1f]|\.[^A-Za-z0-9]|,[^0-9]|!|\?)"句読点を抽出する正規表現waste_expressions / r"(?i)Copyright|All Rights Reserved"フッターに含まれる特徴的なキーワードを指定した正規表現debug / FalseTrueの場合、ブロック情報を出力"""謝辞----オリジナル版の作成者やForkで改良を加えた方々に感謝します。- Copyright of the original implementation:: (c)2007/2008/2009 Nakatani Shuyo / Cybozu labs Inc. All rights reserved- http://rubyforge.org/projects/extractcontent/- http://labs.cybozu.co.jp/blog/nakatani/2007/09/web_1.html- https://github.com/petitviolet/python-extractcontent- https://github.com/yono/python-extractcontent