Saravanan666/pypi-org huggingface dataset:
Package: biasgen
biasgenbiasgenis a Python package which simulates magnetic resonance (MR) non-uniformities. This package allows users to generate custom bias fields by combining radiofrequency (RF) coil spatial information with frequency sampling information.Bias fields are constructed using a sum-of-squares approach with coil sensitivity maps which follow the sinusoidal model ofKern et. al. Direct computation of sinusoidal sensitivities are done in closed form using the segment source solution ofVinas and Sudhyadhom.InstallationPackagebiasgencan be installed using pip:pip install biasgenA CUDA accelerated version ofbiasgenis also available:pip install biasgen[gpu]UsageTo startbiasgenrequires the user to define a set of coil positions and sampling frequencies. Coil positioning can be initialized through a sequence ofCoilSegmentobjects or by using the predefined coil constructor routinecage_constructor. An example of how to usecage_constructoris provided below:importbiasgen# Shepp-Logan phantom exampleph=biasgen.phantom3d(n=128)# returns a sequence of CoilSegment objectscoils=biasgen.cage_constructor(n_coils=2,center=(64,64,64),coil_height=128,length_to_space_ratio=0.35,ellip_axes=(90,65))biasgen.view_coil_positioning(ph,coils)Functionview_coil_positioningprovides a top-down view ofCoilSegmentsequences which can be useful when arranging coil cages. Next step is to define a sampling grid for the sinusoidal sensitivity model:sens_settings=biasgen.SensitivitySettings(grid_lengths=(5,5,5),grid_spacings=(1,1,1))Inputting the sampling information and coil sequence intocompute_sensitivitywill return the sensitivity maps of each coils:# biasgen.use_gpu(True) # Uncomment if GPU is available# first axis will index each coil contributionsens=biasgen.compute_sensitivity(coils,sens_settings,ph.shape,batch_sz=1,scale_fctr=0.5)Arguments "batch_sz" and "scale_fctr" can be helpful for memory-limited devices. "batch_sz" determines how many segments are loaded into memory while "scale_fctr" provides a temporary spatial downsampling for computation. The simulated sensitivity maps can be viewed using the functionview_center_axes:# mask for view_center_axesph_mask=ph>0# visualization requires that a mask is providedbiasgen.view_center_axes(abs(sens),ph_mask,['Z-slice','Y-slice','X-slice'])Finally we construct the measured bias field through a sum-of-squares procedure:bias=biasgen.bias_sum_of_squares(sens)# scalar product application of bias to Shepp-Logan phantombiasgen.view_center_axes(bias*ph,ph_mask,['Z-slice','Y-slice','X-slice'])More detailed examples of sensitivity simualtions and visualizaitons can be found in the examples/bias.ipynb notebook.ReferencesGuerquin-Kern M, Lejeune L, Pruessmann KP, Unser M. Realistic
Analytical Phantoms for Parallel Magnetic Resonance Imaging. IEEE
Transactions on Medical Imaging. 2012;31(3):626-636.Vinas L and Sudhyadhom A. Sinusoidal Sensitivity Calculation for Line Segment Geometries. arXiv.org:2208.03059 [physics.med-ph], Aug. 2022.
Package: biaslyze
The NLP Bias Identification ToolkitBias is often subtle and difficult to detect in NLP models, as the protected attributes are less obvious and can take many forms in language (e.g. proxies, double meanings, ambiguities etc.). Therefore, technical bias testing is a key step in avoiding algorithmically mediated discrimination. However, it is currently conducted too rarely due to the effort involved, missing resources or lack of awareness for the problem.Biaslyze helps to get started with the analysis of bias within NLP models and offers a concrete entry point for further impact assessments and mitigation measures. Especially for developers, researchers and teams with limited resources, our toolbox offers a low-effort approach to bias testing in NLP use cases.Supported ModelsAll text classification models with probability output are supported. This includes models from scikit-learn, tensorflow, pytorch, huggingface transformers and custom models. The bias detection requires you to pass apredict_probafunction similar to what you would get on scikit-learn models. You can find a tutorial on how to do that for pre-trained transformer modelshere.InstallationInstallation can be done using pypi:pipinstallbiaslyzeThen you need to download the required spacy models:python-mspacydownloaden_core_web_smQuickstartfrombiaslyze.bias_detectorsimportCounterfactualBiasDetectorbias_detector=CounterfactualBiasDetector()# detect bias in the model based on the given texts# here, clf is a scikit-learn text classification pipeline trained for a binary classification taskdetection_res=bias_detector.process(texts=texts,predict_func=clf.predict_proba)# see a summary of the detectiondetection_res.report()# launch the dashboard visualize the counterfactual scoresdetection_res.dashboard(num_keywords=10)You will get results as Boxplots, among others, indicating the impact of keywords and concepts on the prediction of your model.
Example output:See more detailed examples in thetutorial.Development setupFirst you need to install poetry to manage your python environment:https://python-poetry.org/docs/#installationRunmake installto install the dependencies and get the spacy basemodels.Now you can usebiaslyzein your jupyter notebooks.Adding concepts and keywordsYou can add concepts and new keywords for existing concepts by editing the concept files inconcepts.
A tutorial on how to create custom concepts and work with them can be foundhere.Preview/build the documentation with mkdocsTo preview the documentation runmake doc-preview. This will launch a preview of the documentation onhttp://127.0.0.1:8000/.
To build the documentation html runmake doc.Run the automated testsmake testStyle guideWe are using isort and black:make styleFor linting we are running ruff:make lintContributingFollow the Google style guide for Python:https://google.github.io/styleguide/pyguide.htmlThis project uses black, isort and ruff to enforce style. Apply it by runningmake styleandmake lint.AcknowledgementsFunded from March 2023 until August 2023 by
Package: biaswrappers
Bias WrappersWrappers for standard multioutput machine learning regressors that apply regularization to training to produce better testing results, with a bias factor. Used mainly to combat bias on seemingly random/biased data. Default models are Linear Regression, however, you can input your own machine learning models with the model param.BiasRegressorC1 uses a progressive regularization method to calculate a penalty to add to data, to prevent overfitting or underfitting due to noise via bias (explicit regularization).BiasRegressorC2 uses another regression model to fit on incorrect predictions and correct answers, to identify patterns of overfitting or underfitting and arrive at a more correct answer (implicit regularization).Fixes0.5.1.3Added the logo!0.5.1.2Small changes to the regressors to allow for continuity with the research paper!0.5.1.1Moved split_size parameter to the constructor to change it easier.0.5.1Redid a lot more of the C1 method to allow for more subtle changes in the right direction: it now closely matches the FakeWrapper but is a lil different. Also, removed features from the postModel of C2 to allow for more pure error learning. Also, renamed FakeWrapper to RandomWrapper.0.5.0Redid most of the C1 method to allow multi-output and specialized penalties through regularization. Also, created a "Fake Wrapper" that applies random penalties from 0 to 1 to test the C1 method fairly, proving the use of the specific penalties. Also, improved compatibility with native sklearn commands for metrics and model selection.0.4.1Small fixes regarding integration with some data, should work for all dimensions in the event of layered array for y_preds. Also, changed the dataset to use the default sklearn diabetes dataset instead of a Friedman problem, and rewrote some commands for clarity.0.4.0Made many fixes to original BiasRegressor, now BiasRegressorC1, and added a second one incorporating machine learning regularization through generated features.0.3.1Fixed Array/List Contradiction in regression, removed classifier for code compatibility, and removed a few print statements.Removed classifier because the formula used only benefits regression problems.InstructionsInstall the package with pip:pip install biaswrappersPython Quickstart:# Import one of the regressors from the package, regressorfrombiaswrappersimportregressorfrombiaswrappers.baseline_testsimporttest_regression# Initialize cregressor and...# Specify a model class (or multiple, for C2) with a fit and predict method as a param.my_regressor=regressor.BiasRegressorC1()# Look at the baseline_tests module for easy teststest_regression(model=my_regressor)# No return values, just prints results
Package: biathlonresults
biathlonresults.com API for PythonFind athlete:importbiathlonresultsathletes=biathlonresults.athletes('boe')foriinathletes['Athletes']:print(i['IBUId'],i['FamilyName'],i['GivenName'])# output:# BTNOR11605199301 BOE Johannes Thingnes# BTNOR12307197201 BOE Karl Gunnar# BTNOR12107199801 BOE Magnus# BTNOR12907198801 BOE Tarjei# ...Get last races of athlete:importbiathlonresultsres=biathlonresults.all_results('BTNOR11605199301')foriinres['Results'][:3]:print(i['Comp'],i['Season'],i['Place'],i['Rank'])# output:# MS 18/19 Oslo 1.# PU 18/19 Oslo 1.# SP 18/19 Oslo 1.Get WC 2019/2020 stages:importbiathlonresultsevents=biathlonresults.events(1920,1)foriinevents:print(i['StartDate'][:10],i['ShortDescription'])# output:# 2019-12-01 Oestersund# 2019-12-12 Hochfilzen# 2019-12-16 Annecy-Le Grand Bornand# 2020-01-06 Oberhof# 2020-01-13 Ruhpolding# 2020-01-20 Pokljuka# 2020-02-12 Antholz-Anterselva# 2020-03-02 Nove Mesto# 2020-03-09 Kontiolahti
Package: bib2bbl
Python 2.6.* or aboveLatex, BibtexHelpbib2bbl.py [-h] [-b FILES]
or
bib2bbl -b yourbibfile.bibUsagepython bib2bbl.py -b yourBibfile.bib
or
bib2bbl -b yourBibfile.biboptional arguments-h, --help            show this help message and exit
-b, --bib FILES       -b bibliography.bib
Package: bib2coa
bib2coaA command-line tool that converts a single bibtex file to a tsv with paper, author that can be used as the foundation for an NSF COA form.InstallTo installcurrent stable version from PyPIpip install bib2coaTo install source clone this repository or download the zip file and unzip and runpip install .From within the source dir tree (wheresetup.pyis).UsageTo build a tab-separated file (TSV) from a bibtex file runbib2coa <filename>This creates an outputfile calledcoa_initial.tsvwhich has two tab-separated columns. Unique authors (col 1) and the paper they come from with the paper year.To see stats on the conversion include--statsflag.To output a file with a different name add the--output my_file.tsv(for example).
Package: bib2coins
bib2coins is a simple tool which will convert BibTeX files to COINS metadata (seehttp://ocoins.info/) ready for inclusion in a webpage. You may want to use this is you have a BibTeX file of your own publications and you display a list of these publications on a webpage. bib2coins can be used to convert the BibTeX files to a set of <span> elements which can be included in your HTML file to allow bibliographic software (such as Mendeley and Zotero) to automatically pick up the metadata from the page and allow the papers on the page to be easily added to the software’s database.Seehttps://github.com/robintw/bib2coinsfor more details
Package: bib2glossary
bib2glossaryThis package is intended to allow for the storage and management oflatex glossary termsin standard reference management packages (such as Zotero),
by converting between.bibfiles
and.texfiles containing\newglossaryentryor\newacronymdefinitions.To date the only other way to achieve this isviabib2gls. However, it implementation is somewhat complex, and the item types it uses are not supported by Zotero.Inbib2glossary, the user may override the default relationships between
reference item fields and glossary term parameters,
by supplying a JSON file, e.g.:{"abbreviation":"abbrevfield"}The defaults are taken from theDictionary Entrytype inZotero.For\newacronym:ParameterFieldmisc@typelongnamejournal*abbreviationshorttitledescriptionabstractpluralserieslongpluralisbnfirstpluraladdress**For\newglossaryentry:ParameterFieldmisc@typenamejournal*descriptionabstractpluralseriessymbolvolumetexteditionsortpublisher* This shows as 'Dictionary Title' in Zotero** This shows as 'Place' in Zotero[Note: Thetitlefield is not used, since it is usely used to generate the key.]Installation>> pip install bib2glossaryUsageConversion of\newacronym:>> bib2acronym --help
>> bib2acronym path/to/file.bib --entry-type misc --param2field path/to/file.jsonor>> acronym2bib --help
>> acronym2bib path/to/file.tex --entry-type misc --param2field path/to/file.jsonConversion of\newglossaryentry:>> bib2glossary --help
>> bib2glossary path/to/file.bib --entry-type misc --param2field path/to/file.jsonor>> glossary2bib --help
>> glossary2bib path/to/file.tex --entry-type misc --param2field path/to/file.jsonImplementationParsing oftexfiles is handled byTexSoupParsing ofbibfiles is handled byBibtexParser
Package: bib2x
bib2xIntroductionbib2xis a tool for parsing and processing BibTeX files.bib2xis currently under development. The latest version is 0.4.0.The current use cases are:Convert BibTeX-files to JSONExamplesbib2x -i turing.bib -o turing.json -f jsonConverts the BibTeX-file "turing.bib" into the JSON-file "turing.json" with the BibTeX entries.bib2x -i turing.bib -o turing.html -f htmlConverts the BibTeX-file "turing.bib" into a file named "turing.html" that contains a HTML list with the BibTeX entries.BackgroundBeing a somehow busy scientific coworkeranda software guy, I wanted to rendermy publicationsformy web site.For this purpose, I wroteBibPres, a commercial tool that uses JSON to store a publications list and JavaScript to render and interact with it.bib2xis a rework of BibPres released as open source. Currently, only the parser is being ported as I want to change it so that it renders plain HTML, not a JSON file.If you have any comments, ideas, or critics, please let me know.Licensebib2xis licensed under theBSD license.DocumentationRunning on the Command Linebib2xis implemented inPython. It is started on the command line.bib2xreads the BibTeX file defined using the--input<BIBTEX_FILE>option. It converts it to the format defined using the option--format<FORMAT>and saves it under the name defined using the option--output<FILE>. Currently, only "json" is available as destination format.Examplesbib2x -i turing.bib -o turing.jsonConverts the BibTeX-file "turing.bib" into the JSON-file "turing.json".Command line argumentsThe script can be started on the command line with the following options:--input<BIBTEX_FILE>/-i<BIBTEX_FILE>: The BibTeX file to load--output<FILE>/-o<FILE>: The file to write--format<FORMAT>/-f<FORMAT>: The type of file to write ['json']--help: Show a help message--version: Show the version informationFurther LinksA complete documentation is located at:https://bib2x.readthedocs.io/en/latest/andhttps://krajzewicz.de/docs/bib2x/index.htmlDiscussions are open athttps://github.com/dkrajzew/bib2x/discussionsThe github repository is located at:https://github.com/dkrajzew/bib2xThe issue tracker is located at:https://github.com/dkrajzew/bib2x/issuesThe PyPI page is located at:https://pypi.org/project/bib2x/ChangeLog for bib2xbib2x-0.4.0 (27.03.2023)Work on the documentationAdded HTML outputFurther testsbib2x-0.2.0 (08.03.2023)Initial version
Package: bib2yaml
Converts a BibTeX file to YAML formatBIB2YAML is a lightweight Python package that provides an easy and efficient way to convert BibTeX (.bib) files to YAML (.yaml) format.Usage# interactive# path to the bib filebib='/Users/aj/Downloads/ref.bib'# path to the output directoryoutputDir='/Users/aj/Downloads/'# Run the functionbib2yaml(bib,outputDir,fileName='ref')# commandlinepythonbib2yaml.py--bib/Users/aj/Downloads/ref.bib--outputDir/Users/aj/Downloads/
Package: bibbliothon
<img src=”https://avatars2.githubusercontent.com/u/13437736?v=3&s=200” width=”50px”> [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://proversity.org)# Bibblio API Python
Python wrapper of Bibblio APIRegister in [Bibblio](bibblio.org) and get your CLIENT_ID and CLIENT_SECRET## Install`pip install bibbliothon`## Configuration`python import bibbliothon `set client_id and client_secret`python bibbliothon.client_id = 'YOUR_CLIENT_ID' ``python bibbliothon.client_secret = 'YOUR_CLIENT_SECRET' `get access_token`python bibbliothon.access_token =bibblio.Token.get_access_token()['access_token']`the access token has a duration of 5 minutes, remember to update it.## UsageFor more information use [Bibblio API Documentation](http://docs.bibblio.apiary.io/)
* payload is always a dict
* limit and page are optional and integers
* text is a string
* content_item_id is a string### Discovery`python response = bibbliothon.Discovery.content_recommendations(content_item_id) ``python (Legacy) response = bibbliothon.Discovery.recommendations(payload) `### Enrichment`python response = bibbliothon.Enrichment.create_content_item(payload) ``python response = bibbliothon.Enrichment.get_content_items(limit=10, page=1) ``python response = bibbliothon.Enrichment.get_content_item(content_item_id) ``python response = bibbliothon.Enrichment.update_content_item(content_item_id, payload) ``python response = bibbliothon.Enrichment.delete_content_item(content_item_id) ``python (Legacy) response = bibbliothon.Enrichment.metadata(text) `
Package: bibbreviate
bibbreviate===========A python script to abbreviate journal names in a bib file using publicly available journal lists.Installation============pip install bibbreviateor download the source andpython setup.py installUsage=====```usage: bibbrev [-h] [-o OUTPUT] [-r] [-a ABBREVIATIONS] [-v] targetpositional arguments:target                The bib file to abbreviate.optional arguments:-h, --help            show this help message and exit-o OUTPUT, --output OUTPUTThe output file name. If missing, output will be sentto stdout.-r, --reverse         Reverse the process and unabbreviate journal names.-a ABBREVIATIONS, --abbreviations ABBREVIATIONSPath to a file of abbreviations in the form (one perline): Journal of Biological Science = J. Sci. Biol.-v, --verbose```WARNING: this package is still in beta.  I use it on my own bib files, but errors are still more than possible.  Be sure to back up your files before using.Development===========The code for this package is hosted on GitHub (https://github.com/Winawer/bibbreviate), and is licensed under the MIT license.  If you have improvements to the package, please submit a pull request and I will be happy to work them in.
Package: bibchex
BibCheX is a tool to sanity- and consistency-check your BibTeX reference files. Aside from checks ensuring your preferred style guidelines are met, Bibchex pulls in bibliographic data from sources such as CrossRef and cross-checks your BibTeX files against this data. Thedocumentationcontains a list of all available checkers and data sources.Getting startedThis walks you quickly through running BibCheX on your .bib file.InstallationInstalling BibCheX from source should be as easy as runningpythonsetup.pyinstallin the source folder. Alternatively, you can install BibCheX from PyPI usingpip:pipinstallbibchexConfigurationConfiguration determines which style rules should be checked for. BibCheX comes with a default configuration which matches my personal taste, but probably not yours. So you can run BibCheX without customizing the config, but you might not be happy with the result.You can find the default configuration atbibchex/data/default_config.jsonin the source. Copy that file to~/.config/bibchex.jsonor anywhere else. If you did copy it to some arbitrary location, you must pass the path to that file via the--configcommand line switch.Have a look at theconfiguration documentationto see what can be configured.RunningBibCheX can be run in three modes. In GUI mode, text mode or silent mode. Okay, “GUI” is kind of a lie, it’s more of a TUI. But anyways, it provides progress bars, so yay for GUI mode!BibCheX expects as first positional argument the path to your.bibfile, and as second a path to a (non-existent) HTML file, to which it will write its output. Running BibCheX (in GUI mode) can be as easy as:bibchex/path/to/my/references.bib/path/to/the/desired/output.htmlThis should open a text UI with some scrolling log messages and progress bars on the top. Once everything is finished, press any key to close the UI and open/path/to/the/desired/output.htmlin any browser to have a look at the result.Running BibCheX without the GUI can be done like this:bibchex--cli/path/to/my/references.bib/path/to/the/desired/output.htmlRemember that you may have to pass your custom configuration JSON file if you have placed in a nonstandard location:bibchex--cli--config/path/to/your/config.json/path/to/my/references.bib/path/to/the/desired/output.htmlPlease Note: The (free) crossref API required a valid email address to be set for usage. By default, a dummy address is configured. Please change this to a valid address before actually using BibCheX!
Package: bibchk
bibchkSimple program to return the BibTeX string of a given DOI(s) or ISBN(s).Installpip install bibchkExample UsageAn example with a DOI and DOI URL:$bibchk10.1002/2016JC011857https://doi.org/10.1002/2016JC011857
@article{Houpert_2016,doi={10.1002/2016jc011857},url={https://doi.org/10.1002%2F2016jc011857},year=2016,month={nov},publisher={AmericanGeophysicalUnion({AGU})},volume={121},number={11},pages={8139--8171},author={L.HoupertandX.DurrieudeMadronandP.TestorandA.BosseandF.D{\textquotesingle}OrtenzioandM.N.BouinandD.DausseandH.LeGoffandS.KuneschandM.LabasteandL.CoppolaandL.MortierandP.Raimbault},title={Observationsofopen-oceandeepconvectioninthenorthwesternMediterraneanSea:Seasonalandinterannualvariabilityofmixinganddeepwatermassesforthe2007-2013Period},journal={JournalofGeophysicalResearch:Oceans}}@article{Houpert_2016,doi={10.1002/2016jc011857},url={https://doi.org/10.1002%2F2016jc011857},year=2016,month={nov},publisher={AmericanGeophysicalUnion({AGU})},volume={121},number={11},pages={8139--8171},author={L.HoupertandX.DurrieudeMadronandP.TestorandA.BosseandF.D{\textquotesingle}OrtenzioandM.N.BouinandD.DausseandH.LeGoffandS.KuneschandM.LabasteandL.CoppolaandL.MortierandP.Raimbault},title={Observationsofopen-oceandeepconvectioninthenorthwesternMediterraneanSea:Seasonalandinterannualvariabilityofmixinganddeepwatermassesforthe2007-2013Period},journal={JournalofGeophysicalResearch:Oceans}}Or with an ISBN:$bibchk0-486-60061-0
@book{9780486600611,title={FundamentalsOfAstrodynamics},author={RogerR.BateandDonaldD.MuellerandJerryE.White},isbn={9780486600611},year={1971},publisher={CourierCorporation}}