Saravanan666/pypi-org huggingface dataset:
Package: cohesion-pipeline
The Cohesion PipelineGiven a division, Cohesion pipeline should give a cohesion score and recommend a suitable name for each group
A suitable should suit each member of the group and be the tightest one (no entities in other groups suits the name), using inter and intra scoreInstallationpipinstallcohesion-pipelineUsage ExampleThe input to the cohesion_score functin must be a csv,txt,tsv file with a tab['\t'] seperator and must have 'label' and 'text' columnsimportpandasaspdfromcohesionimportcohesion_pipelinedata={"text":["we like to play football","I'm playing football better than neymar and cristano ronaldo",'I like Fifa more than I like football, My Fav team is #RealMadrid Hala Madrid','Hamburger or Pizza? what would i choose? I will eat both of them, it so tasty!','banana pancakes with syrup maple, thats my favorite meal'],'label':[1,1,1,2,2]}df=pd.DataFrame(data)score,res=cohesion_pipeline.cohesion_df(df)print("Cohesion Final score is",score)print("Cohesion Topics are:",res)
Package: cohesive
cohesivecohesive is a lightweight segmenter that uses sentence embeddings to split documents into naturally coherent segments akin to paragraphs.InstallationYou can install cohesive using pip:pipinstallcohesiveUsing cohesiveTo start using cohesive, simply import Cohesive and create a new instance of the client:fromcohesiveimportCohesive# By default, cohesive uses the paraphrase-MiniLM-L6-v2 model, which produces good# results, but you can pass the name of any model into the Cohesive constructor.cohesive=Cohesive("msmarco-distilbert-cos-v5")# Then, all you need to do is call the create_segments method and pass in an# array of sentences.cohesive.create_segments(sentences)At the present time, cohesive is only compatible with the sentence-transformers library but additional encoders will be added in the future.Finetuning cohesivecohesive users can finetune several parameters, which all impact the final segmentation results in different ways. Here is a quick summary:window_size:Sets the size of the context window for generating segments. Defaults to 4.louvain_resolution:Used by the Louvain community detection algorithm to partition sentences into segments. Default is 1.framework:The framework to use for calculating similarity scores. Choose between scipy and sklearn. Default is "scipy".show_progress_bar:Flag to display the progress bar from sentence-transformers whilst generating embeddings. Defaults to False.balanced_window:If True, the context window is split evenly between preceding and subsequent sentences, otherwise it only looks at subsequent sentences. Defaults to False.exponential_scaling:Flag to use exponential scaling when calculating similarity scores. Defaults to False.max_sentences_per_segment:Maximum number of sentences per segment. Default is None.To modify the parameters, simply pass in the appropriate parameter name and value when you call the create_segments method:# Via create_segmentscohesive.create_segments(sentences,window_size=3,exponential_scaling=True)Viewing the segmentsWhencreate_segmentshas finished, cohesive will print a summary of the total number of segments that were created.There are several methods for interacting with the generated segments.# View a string representation of the consolidated Segment and Sentence objectscohesive.segments# List that contains the content of each segment.cohesive.get_segment_contents()# View the start and end indices of sentences within a segment.cohesive.get_segment_boundaries()# Print the contents of each segment to the console or Notebook.cohesive.print_segment_contents()
Package: cohmetrix-br-lib
CohMetrix-BRBiblioteca para extração de características linguísticas para o Português Brasileiro.DescriçãoEsse repositório implementa uma versão em biblioteca da API Web Coh-Metrix BR descrito em"Coh-Metrix PT-BR: Uma API web de análise textual para a educação (2020)".Esse é um trabalho em progresso que reimplementa as características como descritas no artigo, todavia permitindo o uso direto em códigos Python.QuickstartA biblioteca é organizada no seguinte formato:---
title: Diagrama de Pacotes
---
flowchart TD

Root(<b>cohmetrixBR</b>\nPacote raiz da biblioteca.)
Root --> Resources(<b>resources</b>\nArmazena modelos e recursos utilizados para\no cálculo das características.)
Root --> Features(<b>features</b>\nContém diferentes módulos com a implementação\ndas características descritas no artigo.)Para utilização, só precisamos importar diretamente o módulo com as características desejadas e invocar a respectiva função. Um exemplo desse processo abaixo:# Importando o módulo com as#   características relacionadas à conectivosfromcohmetrixBR.featuresimportconnectives# Calculando a característica CNCAll para um#   texto qualquer:connectives.CNCAll('Esse é um texto de exemplo.')# 0.0Outra forma de utilizar a biblioteca é calculando múltiplas características de uma única vez. Todos os módulos expõem uma variávelFEATURESque contém a lista de todas as características disponibilizadas naquele módulo. Assim, é possível fazer dessa forma:# Obtendo todas as características presentes#   na bibliotecafromcohmetrixBR.featuresimportFEATURES# Definindo o texto de exemplotext="Texto de exemplo para extração de características"# Calculando todas as característicasfeatures=[f(text)forfinFEATURES]# [1, 1, 1.0, ...,  15.797142857142859, -45.032]InstalaçãoPrimeiro, realiza a instalação da biblioteca viapipou através dogit clone:1. Instalando com o pip# Configurar ambiente virtual# ...# Instalar através do pip$pipinstallcohmetrixBR2. Instalando localmente# Clonar repositório$gitclonehttps://github.com/moesio-f/cohmetrix-br# Acessar diretório$cdcohmetrix-br# Configurar ambiente virtual# ...# Instalar através do pip$pipinstall-e.
Package: cohort-creator
Cohort creatorTL;DRCreates a neuroimaging cohort by aggregating data across datasets.Command line tool to:install a set of datalad datasets from openneuro,get the data for a set of participants,copy the data to a new directory structure to create a "cohort".It takes 2 files as input that should list:datasets to be included in the cohortsubject in each dataset to be included in the cohortBoth of those files can be generated by theneurobagel query tool.For examples of of inputs TSV files see thispage.Itoutputs the cohortfollowing the recommendations
from theBIDS extension proposal 35.RequirementsOperating systemIt is recommended to use this package on a linux / Mac OS.If you are on Windows, try using WSL (Windows Subsystem for Linux) to run this package:
windows does not handle symbolic links well, and this package relies on symlinks.
If you decided to go ahead anyway make sure you have got a LOT of disk space available.More informationherePython dependenciesMake sure you have the following installed:datalad and its dependencies:if you are have anaconda / conda, it should be 'just' a matter of runningcondainstall-cconda-forgedataladBut check theinstallation instructionsfor more details.Other dependencies are listed in the pyproject.toml file.Installationgitclonehttps://github.com/neurodatascience/cohort_creator.gitcdcohort_creator
pipinstall.LimitationsCohorts can only be created by aggregating data from openneuro and openneuro derivatives.Latest datasetsCurrently this should allow you to access more or less the following:Number of datasets: 863 with 37441 subjects including:692 datasets with MRI datawith participants.tsv: 487with phenotype directory: 22with fmriprep: 90 (3937 subjects)with participants.tsv: 74with phenotype directory: 3with freesurfer: 36 (3322 subjects)with participants.tsv: 34with phenotype directory: 2with mriqc: 330 (14607 subjects)with participants.tsv: 248with phenotype directory: 18It may be that very recent datasets are not available yet.Dataset typesOnly possible to get data from:rawmriqcfmriprepNot yet possible to get freesurfer data via the cohort creator, though the data
is available in the sourcedata folder of the fmriprep datasets.Blind spotsIt may be possible that that some metadata files (JSON, TSV) are not accessed
over correctly if they are not in the root of the dataset or the same folder as
the data file.FIXuse pybids / ancpbids for data indexing and querying.DemoTo get from openneuro-derivatives for all T1wthe MRIQC output for each filethe corresponding T1W filerun the following command from within the cohort_creator folder:cohort_creatorinstall\--dataset_listinginputs/datasets_with_mriqc.tsv\--participant_listinginputs/participants_with_mriqc.tsv\--output_diroutputs\--dataset_typesrawmriqc\--verbosity3cohort_creatorget\--dataset_listinginputs/datasets_with_mriqc.tsv\--participant_listinginputs/participants_with_mriqc.tsv\--output_diroutputs\--dataset_typesrawmriqc\--verbosity3cohort_creatorcopy\--dataset_listinginputs/datasets_with_mriqc.tsv\--participant_listinginputs/participants_with_mriqc.tsv\--output_diroutputs\--dataset_typesrawmriqc\--verbosity3
Package: cohort-generator
python-ohdsiPython wrappers for (some) OHDSI tools. This project has been initiated for
supporting OMOP data sources invantage6.Make sure you have a working R environment with the OHDSI packages installed.InstallationPython bindingInteract with the OMOP database using a python interface.Install Java JDK.Install R:sudo apt-get install r-base(setR_HOME)Install R packagespipinstallpython-ohdsiAPI serviceSpin up a small webserver next to the OMOP database to allow HTTP requests to
the OMOP database. You can use the prebuild image from dockerhub:dockerpull...
dockerrun...Or you can build the image yourself:dockerbuild-tohdsi-api.
dockerrun-p5000:5000ohdsi-apiOr you can run the API service directly from the source code:pipinstall-rrequirements.txt
pythonapi.pyBuilding documentationcddocsexportIGNORE_R_IMPORTS=True
makehtmlcddocsSet-Item-PathEnv:IGNORE_R_IMPORTS-ValueTruemakehtmlor you can usemake livehtmlto automatically rebuild the documentation
when a file is changed.You can set theIGNORE_R_IMPORTSenvironment variable to ignore the R imports
in the documentation. This is useful when you don't have the R packages
installed but want to build the documentation anyway.User DocumentationThe user documentation can be found atreadthedocs.
Package: cohospider
Coho SpiderThis is a scraper written by @haaroon and @rachchan that can be used to scrape data from Companies House.RequirementsPython >= 3.7Scrapy >= 2.8.0Companies House Developer Hub Account/REST API KeyList of Company Numbers from Companies House to scrape (optional)We have included a list of companies if you do not have any, but it may not be up to date.You can get an API key from the Companies House website.You can also contactCompanies Housedirectly, their support and developer teams are extremely friendly and can get you direct access to bulk read only data.Installation GuideFirst, open up a new terminal and install our scraper.pip install cohospiderNext, open up your python terminal of choice, pick a spider to use and enter the following commands.Scraping Persons With Significant ControlIf you would like to obtain JSON data on a company's Persons With Significant Control, you can follow the following commands:from spiders import CohoPscSpiderRunWith default Company datapsc_runner = CohoPscSpiderRun(key="INSERT_API_KEY_HERE")OR with your own company datapsc_runner = CohoPscSpiderRun(key="INSERT_API_KEY_HERE", company_numbers=[COMPANY_NUMBER1, COMPANY_NUMBER2, etc..])psc_runner.start()The output will follow this JSON format:https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/list?v=latestScraping DirectorsIf you would like to obtain JSON data on a company's Directors, you can follow the following commands:from spiders import CohoOfficerSpiderRunWith default Company dataofficer_runner = CohoOfficerSpiderRun(key="INSERT_API_KEY_HERE")OR with your own company dataofficer_runner = CohoOfficerSpiderRun(key="INSERT_API_KEY_HERE", company_numbers=[COMPANY_NUMBER1, COMPANY_NUMBER2, etc..])officer_runner.start()The output will follow this JSON format:https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/officerlist?v=latestScraping for our example notebookIf you are following our example notebook/blog on Companies House in Raphtory, you will need to use our barbara-spider:from spiders import BarbaraSpiderRunbarbara_runner = CohoOfficerSpiderRun(key="INSERT_API_KEY_HERE")barbara_runner.start()The output will follow this JSON format:https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/officerlist?v=latestAll these runners produce adatafolder in your root directory, where you can find all your JSON data, ready to be used in Raphtory for analysis.LicenseTHE 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: coh-piggs-extractor
coh-piggs-extratorA module that allows the extracting of files from a City Of Heroes. The pigg file is used to create "virtual drives" to
load data from during the running of the game.Basically it is similar to a zip file and therefore can be processed by parsing the files and extracting the informationUsageThe design of this library is simple in use. The library makes use of a simple implementation of thestrategypattern to process each of the entries of the pigg file.With this in mind there are two objects of interest:coh_piggs_extractor.coh_piggs_extractor.PiggFile(pigg_file_path,strategy)This is used to load the pigg file and process the contents to get the metadata and data for each of the contained files.
The constructor takes two parameters (as shown above):pigg_file_path: The path to the pigg fileThe strategy implementation used to process each of the filecoh_piggs_extractor.coh_piggs_extractor.PiggFileEntryProcessingStrategyThis is a simple no op class that implements the expected strategy interface. It has one functionprocess_pigg_file_entrythat is called for each of the files in the pigg file. The function takes two parameters
as follows:meta: This is the metadata of the file and is a simple value object DirEntry (defined incoh_piggs_extractor). The main entry of use is the name field.data: This is the binary data that has been extracted for the file.A simple file extracting strategy has been provided as wellcoh_piggs_extractor.coh_piggs_extractor.SimpleFileOutputEntryProcessingStrategy(out_dir)This will output each of the contained files into the specifiedout_dirprovided during construction.
Package: coh-summarizer
SummarizerRequires model:pl_nask-0.0.5.tar.gzfromhttp://mozart.ipipan.waw.pl/~rtuora/spacy/Install:python-mpipinstallpath/to/pl_nask-0.0.5.tar.gz
python-mpipinstallpath/to/summarizer-0.0.1-py3-none-any.whlUsage:fromsummarizerimportSummarizersummarizer=Summarizer()text="..."limit=300unit="words"# "words" or "chars"out=summarizer.summarize(text,limit,unit)# dict or KeyErrorAlternatively use loaded model:importspacyfromsummarizerimportSummarizernlp=spacy.load('pl_nask')summarizer=Summarizer(nlp_model=nlp)Output dict:{
    'status': str 'correct' or 'failed',
    'message': str,
    'summary': str,
    'event_id': int,
    'algorithm': str,
}alg_namesshould be displayed in the dropdownout['message']should be displayed in task resultsevent_idmessagestatus0Nonecorrect1Limit wyrazów jest zbyt wysoki. Utworzono podsumowanie zawierające {} wyrazów.correct2Limit wyrazów jest zbyt niski. Utworzono podsumowanie zawierające {} wyrazów.correct10Nie udało się przetworzyć tekstu.failed11Przesłano zbyt krótki tekst.failed12Limit liczby wyrazów jest zbyt wysoki. Nie udało się stworzyć podsumowania.failed13Limit liczby wyrazów jest zbyt niski. Nie udało się stworzyć podsumowania.failed
Package: coi
coi: manage shell script templates for reuseI often improvise the same (boring) bash scripts over and over again.
This is my solution to cut the repetitive work.This command-line tool canmanage (CRUD) templatesrun template command with substitutionskeep track of commands run in each folder for later referenceexamplesThree examples are in order here.
They are all small frequentforloops.
One could alternatively define shell functions for them.In the first example, I need to delete jobs with some key word. The varying part
isBIHYEW10.for x in `qstat -u nosarthur |grep BIHYEW10 |awk '{print $1}'`; do
  qdel $x
doneWithcoiset up, I can simply docoi run -i BIHYEW10The corresponding template isfor x in `qstat -u nosarthur |grep $i |awk '{print $$1}'`; do
  qdel $$x
doneNote that it's simply the Python
[template strings](https://docs.python.org/3/library/string.html#template-strings]).In the second example, I often need to process data with a common directory
pattern, e.g.,ABC_5/ABC-out.cms:fordnamein*_5/;dopython3process.py$dname${dname%/}-out.cms;doneHere the variable parts arefolder name pattern:*_5/command:$ABIN/generate.pyAfter saving a template, we can runcoi run -i "*_5" -c "python3 process.py" some-pathand the template iscd $path
for dname in $i; do
  $c $$dname$${dname%/}-out.cms
donewheresome-pathwill substitute$path.In the third example, I often want to know how many jobs are done in many folders,
and the criteria of 'done' may vary.Suppose the folder structure is as followsjobs-folder
├── sub1
│   ├── 1.input
│   ├── 1.output
│   └── 2.input
├── sub2
│   ├── 1.input
│   └── 2.input
├── sub3
│   ├── 1.input
│   ├── 1.output
│   ├── 2.input
│   └── 2.output
└── sub4
    ├── 1.input
    └── 1.outputcoi-c"wc -l"\-o"ll *.output"\-i"ll *.input"\jobs-foldercommandsruncommandcoi run -i <i> -c <c> -o <o> -t <name> <path>: run template command<name>templatescommandcoi templates add <name>: create a new template called<name>coi templates cp <name> <new-name>: copy<name>to a new template called<new-name>coi templates ll <name>: show content of template<name>coi templates ls <name>: show path of template<name>; You can pass it
to your favorate editor.coi templates rm <name>: delete template<name>coi templates set <name>: set template<name>as default templatecoi templates set: show default template nameTheruncommand takes up to 3 parametersc, 'o', and 'i'. If template-tis not specified, default template is used. If<path>is omitted, current
working directory is used.customizationUser defined templates are saved/searched in$XDG_CONFIG_HOME/coi(most likely~/.config/coi/).other tune-upsalias coir='coi run'
alias coit='coi template'designEssentially this is a tool for shell script templating, with up to 3 substitutions.templates are saved insystem folder: defaultXDG/coi/templates/: user definedthe user defined templates shadow default ones if name clashesTODO:default templateauto complete for templatesintegration with fzfIf json files exists in a path, we can let the user pick with fzf
Package: coiled-venv
coilLet ithatch, watch itcoilhatchis a great virtualenv manager IMHO. But pure virtualenv management can be simpler!coilaims to be as simple as possible and with no external dependencies: keep the OS site-packages clean, that's why we use virtualenvs to start!the future➜ myproject coil
No env configured for /home/fopina/projects/myproject
➜ myproject coil -c thisenv
/home/fopina/.virtualenvs/thisenv created
/home/fopina/.virtualenvs/thisenv assigned to /home/fopina/projects/myproject
/home/fopina/.virtualenvs/thisenv loaded
(thisenv) ➜  myprojectOnce an env is created and assigned to a path it can be loaded without any hassle➜ myproject coil
/home/fopina/.virtualenvs/thisenv assigned to /home/fopina/projects/myproject
/home/fopina/.virtualenvs/thisenv loaded
(thisenv) ➜  myprojectSame env is loaded from any subdirectory➜ src pwd
/home/fopina/projects/myproject/src
➜ src coil
/home/fopina/.virtualenvs/thisenv assigned to /home/fopina/projects/myproject
/home/fopina/.virtualenvs/thisenv loaded
(thisenv) ➜  srcAnd it can assigned/re-used by as many paths as you want➜ otherproject coil
No env configured for /home/fopina/projects/otherproject
➜ myproject coil thisenv
/home/fopina/.virtualenvs/thisenv assigned to /home/fopina/projects/otherproject
/home/fopina/.virtualenvs/thisenv loaded
(thisenv) ➜  otherproject
Package: coilpy
CoilPyThis is Caoxiang Zhu's personal Python package for plotting and data processing.
Documentation can be found athttps://zhucaoxiang.github.io/CoilPy/InstallYou can install the package usingpip.pip install coilpyOr from the GitHubpip install git+https://github.com/zhucaoxiang/CoilPyYou can also install it after cloning the source code (this is useful if you have errors usingpip).pip install -e .orpython setup.py installUseAfter installation, in your python kernel, you can use the functions by something likefromcoilpyimport*You can always check the docstring of each functions, likeFourSurf?in ipython.ContactYou can report bugs onGitHub issuesand propose improvements usingpull request.
For more information, please contact Dr. Caoxiang ZHU (caoxiangzhu[at]gmail.com).
Package: coima
Small template engine that replaces variables via dictionary values:cat file.txt
"This is a {{variable}} in a {{string}}"

from coima import Template
t = Template({'variable':'word', 'string':'sentence'}, 'file.txt')

t.render()

u"This is a word in a sentence"SyntaxNo Python or code blocks are allowed, this is basically adumbtemplating
engine.Variables should be a one word or 2 words together with an underscore. These are
valid variables:{{variable}}
{{variable_one}}Invalid variables are left ‘as is’ and left in the final rendered template.
Package: coimbra-chamber
Table of ContentsDescriptionInstallationGetting StartedPython VersionMySQL DatabasePreferred Way to Run TestsImagesDescriptionBack toTable of ContentsDescription will go here.InstallationRun the following to install:$pipinstallcoimbra_chamberGetting StartedBack toTable of ContentsWe must configure our database before running any analysis:First, we must decide if we want to use an in-memory SQLite database or point to an instance of a MySQL database.
Then we need to create a config file in our working directory to reflect our configuration.Create a copy of the fileexample-config.inifrom the repository and rename it toconfig.ini.
Move theconfig.inifile that we just created into your working directory and open the file.
Change database_type tomemoryif we chose an in-memory database above.
Otherwise, leave the database_type asMySQLand replace thehost,user, andpasswordfields with the host, username, and password for MySQL database we choose.Then, to run an analysis:>>>importcoimbra_chamberascc>>>manager=cc.DataManager()>>>manager.run()Follow the prompts in the terminal to complete your analysis.Python VersionBack toTable of ContentsThis module is intended to use Python 3.6. and above.MySQL DatabaseBack toTable of ContentsNOTE: In order to run the integration tests, a local version of mySQL must be
installed and running.On OSX you can run the following line to start the mySQL service after
installing from LINK$sudolaunchctlload-F/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plistStopping the mySQL service:$sudolaunchctlunload-F/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plistPreferred Way to Run TestsBack toTable of Contents1. From the repo directory; i.e., coimbra_chamber
.. code-block:: bash$ python -m pytest tests -xv  –cov=coimbra_chamber –cov-report html testsThe above line requires bothpytestandpytest-covare installed.ImagesBack toTable of Contents
Package: coimealta
coimealtaA keeper (coimealta in Irish) for personal and household information.I decided I needed to organize my household stuff and my contacts
information, and went for a simple CSV-based system; a proper database
would have been overkill, and would have been less convenient for data
entry and editing.There are two parts to the software, in separate directories:inventory, andcontacts.It's for keeping my information, and I named it after Sliabh Coimeálta
(Keeper Hill) in Ireland, which I used to live near.