Saravanan666/pypi-org huggingface dataset:
Package: claw
Claw,https://github.com/tictail/claw, is a library to extract message quotations and signatures.
It is is a more light-weight version of the originalhttps://github.com/mailgun/talonlibrary.ChangelogIf you ever tried to parse message quotations or signatures you know that absence of any formatting standards in this area could make this task a nightmare.
Hopefully this library will make your life much easier.Installationpip install clawUsageHere’s how you initialize the library and extract a reply from a text
message:importclawfromclawimportquotationsclaw.init()text="""Reply

-----Original Message-----

Quote"""reply=quotations.extract_from(text,'text/plain')reply=quotations.extract_from_plain(text)# reply == "Reply"To extract a reply from html:html="""Reply
<blockquote>

  <div>
    On 11-Apr-2011, at 6:54 PM, Bob &lt;bob@example.com&gt; wrote:
  </div>

  <div>
    Quote
  </div>

</blockquote>"""reply=quotations.extract_from(html,'text/html')reply=quotations.extract_from_html(html)# reply == "<html><body><p>Reply</p></body></html>"Often the best way is the easiest one. Here’s how you can extract
signature from email message without any
machine learning fancy stuff:fromclaw.signatureimportextract_signaturemessage="""Wow. Awesome!
--
Bob Smith"""text,signature=extract_signature(message)# text == "Wow. Awesome!"# signature == "--\nBob Smith"Quick and works like a charm 90% of the time. For other 10% you can use
the power of machine learning algorithms. See the original talon implementation.Developmentvirtualenv venv
source venv/bin/activate

make install

make testRelease new version:Bump the version in setup.py and update CHANGELOG.md, and then:make release
Package: claws
Claws: Crossref Labs AWS ToolsClaws is a Python module that provides a simple and convenient way to interact with AWS services, such as S3 and CloudWatch. It utilizes the boto3 library and aiohttp for asynchronous operations, making it ideal for applications that require high-performance and efficient resource utilization.This is a prototype Crossref Labs system. It is not guaranteed to be stable and the metadata schema and behaviour may be subject to change at any time.FeaturesS3 client and resource management with automatic deferred initializationPresigned URL generation for S3 objectsAsynchronous downloading of multiple S3 objectsRetrieval of S3 objects as stringsCustom exception handling for S3 object retrieval errorsEasy integration with monitoring and instrumentation toolsStreaming upload to S3 to handle large JSON filesRequirementsPython 3.6 or higherboto3aiohttpsmart-openInstallationTo install the Claws module, simply use the following pip command:pip install clawsUsageHere is a basic example of how to use the Claws module to interact with AWS S3:from claws.aws_utils import AWSConnector


# Initialize the AWSConnector with a specific S3 bucket
connector = AWSConnector(bucket="my-bucket", unsigned=False)

# Download an S3 object as a string
result = connector.s3_obj_to_str(bucket="my-bucket", s3_path="path/to/object.txt")

# Download multiple S3 objects asynchronously in parallel
s3_objects = ["path/to/object1.txt", "path/to/object2.txt", "path/to/object3.txt"]
results = connector.get_multiple_s3_objs(bucket="my-bucket", s3_objs=s3_objects)

for result in results:
    print(result)ContributingContributions to the Claws module are welcome. Please feel free to submit pull requests or report issues on the GitHub repository.LicenseClaws is released under theMIT License.Credits.gitignorefrom Github.AWS Lambda Powertoolsby Amazon.© Crossref 2023
Package: claymore
This is a package that has useful machine vision for use with CarsCHANGE LOGRELEASE 10.0.0.1  (7/27/2021)First Release\RELEASE 20.0.0.2 –> 7/27/2021Just wanted to test some things outreally didn’t don anything\-RELEASE 3
-0.0.0.3–> 7/27/2021
-Just wanted to test some things out
-really didn’t don anything
Package: clayton
# clayton## Sampling from copulaeThe modeling of dependence between random variables is an important subject in several
applied fields of science. To this aim the copula function can be used as a margin-free description of the dependence structure. Several copulae belong to specific families such as Archimedean, Elliptical or Extreme. While software implementation of copulae has been thoroughly explored in R software, methods to work with copula in Python are still in their infancy. To promote the dependence modeling with copula in Python, we have developed clayton, a library that provides a range of random vector generation vector for copulae.The module clayton is implemented using the object-oriented features of the Python language. The classes are designed for Archimedean, elliptical, extreme value copulae. Each contains methods to generate random vectors.For more information, the reader can access the paper describing the code, which was accepted for publication in computo, at the following URL:https://aleboul.github.io/computo/.## Installation### DependenciesCOPPY requires :Python (>= 3.7)NumPY (>= 1.14.6)SciPY (>= 1.1.0)### Source CodeYou can check the latest sources with the command:git clone https://github.com/Aleboul/clayton/## Examples[Graphical Representations](https://github.com/Aleboul/clayton/blob/master/examples/sample.ipynb)
Package: claytron.featuring
IntroductionHip hop music is notorious for adding extra information into the artist
and track names. This script helps you normalize and move those pesky(Feat. Some Artist)strings in your iTunes library. The script
allows you to make a selection in iTunes, then run the script against
those tracks from the command line.Code Repositoryhttps://github.com/claytron/claytron.featuringPyPihttp://pypi.python.org/pypi/claytron.featuring/Issueshttps://github.com/claytron/claytron.featuring/issuesInstallationThis script can be installed with pip. I would also recommend installing
it into a virtualenv:$ pip install -U claytron.featuringUsageYou can see the usage string from the-hoption:$ featuring_fix -h
Usage: featuring_fix [options]

This script will allow you to modify the tracks in your iTunes database.
Select the items that you want to modify in iTunes, then run this script from
the command line using the options below. The "featuring" strings will be
normalized and added to the comment tag as (Featuring Some Artist). The
previous contents of the comment will be left intact.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -r, --real-run        Change the iTunes database (default: False)
  -c, --with-csv        Write change info into a CSV file
  -w, --featuring-with  Take care of 'with'
  -n, --no-parens       Process the tracks without parenthesis (be CAREFUL
                        with this option, since "featuring" is a common word)By default the script does not modify the iTunes database since there is
no real undo in iTunes. If you want to see what the result of the
modification will be, you can runfeaturing_fixwith the csv output
option:$ featuring_fix -cIf you want to modify the files in your library, you must use the-roption:$ featuring_fix -rWARNING: This can take a long time to process a large selection of
tracks. If you want to run it against your whole library, make sure and
have some music playing, then go grab a coffee.Featuring StylesThere are many different ways in which a track can be tagged as
“featuring” an artist. A few examples:Featuring Mr. Lif
Feat. Mr. Lif
Ft. Mr. Lif
f. Mr. Lif
f/Mr. Lif
with Mr. Lif
w/Mr. lifAnd I’m sure there are other incarnations of these EVIL strings.
Currently the script can handle all but thew/andf/items from
the list above.Changelog1.0.1 (2011-05-08)Updated docs with the code repo and issue tracker links1.0 (2011-05-08)Initial release
Package: clc
clc (command line charts)=========================Simple charts on the commandline (bar charts only for now). Read from stdin orfrom a file.install-------`pip install clc`. Done.usage-----Give `clc` data on stdin or a filename, and see a command line chart.> cat ./fixtures/sample1.dat | clcParis  ******************************  12Tokyo  *******  3London  ***********************************  14Washington  *****************  7Adjust the width of the chart, and the symbol for the bars:> clc ./fixtures/sample1.dat -w30 --tick='~'Paris  ~~~~~~~~~~~~  12Tokyo  ~~~  3London  ~~~~~~~~~~~~~~~  14Washington  ~~~~~~~  7Data should be formatted as in ./fixtures:Paris 12Tokyo 3London 14Washington 7help----Via `--help`:usage: clc [-h] [--verbose] [--width WIDTH] [--tick TICK] [infile]clc: simple charts on the command line.positional arguments:infile                data file (or stdin)optional arguments:-h, --help            show this help message and exit--verbose, -v--width WIDTH, -w WIDTH--tick TICK, -t TICKfuture------- better handle non-integer values- use csv.Sniffer()- tests- colors- vertical bar charts
Package: clcell
clcellclcellis an OpenCL-accelerated cellular automata simulator for Python 3.FeaturesOpenCL-based hardware accelerationCustom rulesets viaclcell.RuleSetParallel simulations viaclcell.CASimulator.batch_simulateLimitationsOnly binary cell statesNo support for infinite gridsGrid boundary cells must be unpopulatedInstallationRegardless of the installation method you choose, you will needOpenCLdrivers for your hardware.Using pip$ pip install --user clcellBuilding from SourceRequirements:GNU MakeFutharksetuptoolsClone this repository:$ git clone https://github.com/Foxbud/clcell.gitEnter the project directory:$ cd clcellBuild and install this package:$ make installUsageimportnumpyasnpimportclcell# Instantiate a simulator using Conway's Game of Life as the ruleset.sim=clcell.CASimulator(clcell.LIFE)# Create a randomized game state to use as a seed.seed_state=np.random.randint(0,2,(1023,1023),dtype=np.int8)# Pad state with zeros (required for now).seed_state=np.pad(seed_state,1,constant_values=0)# Simulate 10,000 generations based on that seed.final_state=sim.simulate(10000,seed_state)# Create a batch of 1,000 randomized, padded game states to use as seeds.seed_states=np.array([np.pad(np.random.randint(0,2,(127,127),dtype=np.int8),1,constant_values=0)fornuminrange(1000)])# Simulate 1,000 generations based on each of those seeds.final_states=sim.batch_simulate(1000,seed_states)Changelogv1.0.1Simplified how the device code checks for boundary cells.Refactored device code to use grids of 8-bit cells as opposed to 32-bit.Fixed incorrectly placed size annotations in one device function.v1.0.0Initial release.
Package: clcert-chachagen
ChaCha20-Generator-Utilities - PythonUses the ChaCha20 implementation in pycryptodomehttps://pycryptodome.readthedocs.io/en/latest/as a base for various functions related to random number generation.The actual file is chacha20_generator.py inside the folder "clcert_chachagen", but we structured it this way to make use of setup.py and make the python version a proper package.Install package$ pip install clcert_chachagenExamplesimportclcert_chachagenaschachagen# Create a chacha object with a zeros seedchacha_zero=chachagen.ChaChaGen()# Create a chacha object with a seed (hexadecimal)chacha=chachagen.ChaChaGen("5ee5e2327a68a9db8a78efdaa855d102ed8bf14e128e0a72ae1c9d72e5f9747e27479f21dfbfd501")# Get a float in [0, 1)chacha.random()# 0.47738372261817247# Get 3 random byteschacha.getbytes(3)# b'\\1N'# Get 5 random bits (an integer between 0 and 2^5 - 1)chacha.getrandbits(5)# 9# Get a number between [1, 100]chacha.randint(1,100)# 71# Shuffle an arraychacha.shuffle([1,2,3,4])# [4, 1, 3, 2]# Get a single random element from an arraychacha.choice([1,2,3,4])# 3# Get an array of 5 elements from a given array. The elements could be repeated.chacha.choices([1,2,3,4],5)# [4, 3, 1, 4, 4]# Get an array of 3 elements from a given array. The elements can't be repeated.chacha.sample([1,2,3,4,5],3)# [4, 5, 3]# Reseed (essentially the same as creating an entirely new one with the new seed)chacha.reseed("8ee5e2327a68a9db8a78efdaa855d102ed8bf14e128e0a72ae1c9d72e5f9747e27479f21dfbfd501")
Package: clc-export-tool
UsageTypeestool –helpto see general help.The tool supports two commands: export and types. The former to export data into text files and
the later to find the exact spelling/version document type identifiers.estool exportexportallows to query for data from Elasticsearch and pipe it into a file.Without the –fields argument you get the json messages, one per line.
When you specify –fields the tool create tab separated lines, one line per message.usage: estool export [-h] [-f FIELDS [FIELDS ...]] [-s START] [-e END]
                     [-t TOP]
                     index doc_type [query]

positional arguments:
  index                 index pattern (without the appended date)
  doc_type              full document type (including version)
  query                 query in lucence syntax https://goo.gl/n9zJSx

optional arguments:
  -h, --help            show this help message and exit
  -f FIELDS [FIELDS ...], --fields FIELDS [FIELDS ...]
                        list of fields
  -s START, --start START
                        start time for query
  -e END, --end END     end time for query
  -t TOP, --top TOP     only return the first TOP itemsestool typestypesallows to identivy the available document types. in the export command one need to specify the
document type as the second parameter and this command helps to identifiy what is available.usage: estool types [-h] index

positional arguments:
  index       index pattern (without the appended date)

optional arguments:
  -h, --help  show this help message and exitQuery syntax[query string syntax on Elasticsearch.co](https://goo.gl/n9zJSx)
Package: clcomuna
clcomunaVery simple package that, given the name of a comuna
from Chile, returns its codeDescriptionEachcomunain Chile has a unique code that makes easier to map them to
different attributes (e.g. choropleth). Since I was going through the hassle
of doing it each time I had a new project, I decided to build a very simple
tool that could automate the task. I hope this can be of use to other
developers / civic-hackers.I added a fuzzy version for cases where there was no exact match.FeaturesGiven a comuna name, it returns its code, taking care of special characters, uppercases and lowercases.If it doesn’t find an exact match, it prints that and returns NoneA fuzzy function returns the best match (uses fuzzywuzzy)You can specify to print the score of the fuzzy matchYou can specify a threshold above which it should return a match and below which it shouldn’t.There is a function that tries the exact match and if it doesn’t find it, it goes to the fuzzy version.The list of comunas-code is a simple CSV file for easier edition.If you want some comuna name version added to the csv file, just contact me and I’ll add them right away.Installationpip3 install clcomunaRequirementsfuzzywuzzyPython3.3+Usage:>>> import clcomuna(If there is a warning, ignore it. It comes with the dependency)get_code>>> clcomuna.get_code("peumo")
'06112'get_fuzzy: returns name, not code>>> clcomuna.get_fuzzy("alragobo")
'ALGARROBO'
>>> clcomuna.get_fuzzy("alragobo", True)
('ALGARROBO', 71)
'ALGARROBO'
>>> clcomuna.get_fuzzy("alragobo", True, 72)
('ALGARROBO', 71)
Score lower than minimum threshold for comuna: ALRAGOBO - ALGARROBOThe optional second parameterTrueprints the found comuna and the score.
The optional third parameterintstablishes a threshold for the function to
return the best name matchget_steps>>> clcomuna.get_steps("alragobo")
Could not find code for:  ALRAGOBO
'ALGARROBO'
>>> clcomuna.get_steps("alragobo", False, 74)
Score lower than minimum threshold for comuna: ALRAGOBO - ALGARROBO
Package: cld2-cffi
CFFIbindings for CLD2This package contains the CLD (Compact Language Detection) library as
maintained by Dick Sites (https://code.google.com/p/cld2/). The first
fork was done at revision r161. It also contains python bindings that
were originally created byMike
McCandless.
The bindings have gone through several hands, with the latest changes being made
to rework the bindings forCFFI.These bindings are identical in API to the original cld2 bindings, and as a
result can be used as a drop in replacement.TheLICENSEis the same as Chromium’s LICENSE and is included in theLICENSEfile for reference.InstallingShould be as simple as$pipinstallcld2-cffiDevelopment VersionThelatest development versioncan be installed directly from GitHub:$pipinstall--upgrade'git+https://github.com/GregBowyer/cld2-cffi.git'Usageimportcld2isReliable,textBytesFound,details=cld2.detect("This is my sample text")print('  reliable:%s'%(isReliable!=0))print('  textBytes:%s'%textBytesFound)print('  details:%s'%str(details))# The output looks like so:#  reliable: True#  textBytes: 24#  details: (('ENGLISH', 'en', 95, 1736.0), ('Unknown', 'un', 0, 0.0), ('Unknown', 'un', 0, 0.0))DocumentationFirst, you must get your content (plain text or HTML) encoded into UTF8
bytes. Then, detect like this:isReliable,textBytesFound,details=cld2.detect(bytes)isReliableis True if the top language is much better than 2nd best language.textBytesFoundtells you how many actual bytes CLD analyzed (after removing HTML tags,
collapsing areas of too-many-spaces, etc.).detailshas an entry per top 3 languages that matched, that includes the percent
confidence of the match as well as a separate normalized score.The module exports these global constants:cld2.ENCODINGSlist of the encoding names CLD recognizes (if you provide hintEncoding, it
must be one of these names).cld2.LANGUAGESlist of languages and their codes (if you provide hintLanguageCode, it must
be one of the codes from these codes).cld2.EXTERNAL_LANGUAGESlist of external languages and their codes. Note that external languages
cannot be hinted, but may be matched if you passincludeExtendedLanguages=True(the default).cld2.DETECTED_LANGUAGESlist of all detectable languages, as best I can determine (this was reverse
engineered from a unit test, ie it contains a language X if that language
was tested and passes for at least one example text).AuthorsPlease seeAUTHORS.Reporting bugsPlease seeBUG_REPORTS.ContributePlease seeCONTRIBUTING.LicencePlease seeLICENSE.
Package: cldfcatalog
cldfcatalogUtilities to usegitrepository clones and reference catalogs.Research data - and in particular CLDF data - is often curated usinggitrepositories
for version control.cldfcatalog.Repositoryprovides a wrapper around GitPython'sgit.Repoclass, exposing relevant functionality
in this context.A particularly important piece of data for CLDF are reference catalogs, which are
consulted during CLDF data creation. Again, such catalogs are often available asgitrepositories hosted on GitHub, such asGlottologorConcepticon.The typical usage scenario for these catalogs is as follows:To follow upstream development of the catalogs, a user has a local clone of the
repository, which is periodically synched runninggit pull origin.When creating a CLDF dataset, a particular released version of a catalog is consulted.Thus, we want tocheckout a particular version of the catalog,run the CLDF creation,restore the previous state of the repository clone.This is exactly the functionality ofcldfcatalog.Catalog:>>>fromcldfcatalogimportCatalog>>>glottolog=Catalog('../../glottolog/glottolog','v4.0')>>>glottolog.active_branch'master'>>>withglottolog:...print(glottolog.describe())...v4.0>>>glottolog.describe()'v4.0-52-ga4cfc90'Configurationcldfcatalogsupports discovery of local paths to catalog clones via a configuration file.
If a filecatalog.iniis found atappdirs.user_config_dir('cldf')(seeappdirs) is found, itsclonessection is used as a
mapping fromCatalog.cli_name()to clone path. Thus, with a configuration[clones]clts=/home/forkel/.config/cldf/cltsa catalog can be intialized aswithCatalog.from_config('clts',tag='v1.0'):...When cloning a catalog,
runningCatalog.clone,appdirs.user_config_dir('cldf')will be used as directory for
the clone, and the path will be written to the config file.To add add paths to a config file use it as context manager:fromcldfcatalogimportConfigwithConfig.from_file()ascfg:cfg.add_clone(key,path)
Package: cldflex
cldflexConvert FLEx data to CLDF-ready CSV.Many descriptive linguists have annotated language data in a FLEx (SIL's Fieldworks Lexical Explorer) database, which provides perhaps the most popular and accessible assisted segmentation and annotation workflow.
However, a reasonably complete data export is only available in XML, which is not human-friendly, and is not readily converted to other data.
A data format growing in popularity is theCLDF standard, a table-based approach with human-readable datasets, designed to be used inCLLDapps and easily processable by any software that can readCSVfiles, includingR,pandasor spreadsheet applications.
The goal ofcldflexis to convert lexicon and corpus data stored in FLEx to CSV tables, primarily for use in CLDF datasets.Installationcldflexis available onPyPI:pipinstallcldflexCommand line usageAt the moment, there are three commands:cldflex corpusfor.flextextfiles;cldflex dictionaryandcldflex wordlistfor.liftfiles.
All commands create a number of CSV files.
One can either usecldfbenchto create one's own CLDF datasets from these files, or add the--cldfargument to create a simple CLDF dataset.
Project-specificconfigurationcan be passed by--conf your/config.yaml, or creating a filecldflex.yamlcorpusBasic usage:cldflexcorpustexts.flextextConnect the corpus with the lexicon:cldflexcorpustexts.flextext--lexiconlexicon.liftCreate a CLDF dataset:cldflexcorpustexts.flextext--lexiconlexicon.lift--cldfdictionaryExtract morphemes, morphs, and entries fromlexicon.lift:cldflexdictionarylexicon.liftCreate a CLDF dataset with aDictionarymodule:cldflexdictionarylexicon.lift--cldfwordlistCreate a CLDF dataset with aWordlistmodule:cldflexwordlistlexicon.lift--cldfAPI usageThe functions corresponding to the commands above arecldflex.corpus.convert()andcldflex.lift2csv.convert().ConfigurationThere is no default configuration.
Rather,cldflexwill guess values for most of the parameters below and tell you what it's doing.
It is suggested to start out configuration-free until something goes wrong or you want to change something.
Create aYAMLfile for CLI usage, pass a dict to theconvertmethods.obj_lg: the object languagegloss_lg: the language used for glossing / translationmsa_lg: the language used for storing POS informationlang_id: the value to be used in the created tablesglottocode: used to look up language metadata from glottologcsv_cell_separator: if there are multiple values in a cell (allomorphs, polysemy...), they are by default separated by"; "form_slices: set tofalseif you don't want form slices connecting morphs and word formsmappings: a dictionary specifying name changes of columns in the created CSV files