Saravanan666/pypi-org huggingface dataset:
Package: chocomufin
Choco-Mufin[CHaracter Ocr COordination for MUFI iN texts]Tools for normalizing the use of some characters and checking file consistencies. Mainly target at dealing with
overly diverse ways to transcribe medieval data (allographetic and graphematic for example) while keeping information
such as abbreviation, hence MUFI.Installpip install chocomufinCommandsThe workflow is generally the following: you generate a conversion table (chocomufin generate table.csv your-files.xml), then
use this table to either control (chocomufin control table.csv your-files.xml) or convert them (chocomufin convert table.csv your-files.xml).
Conversion will automatically add a suffix which you can define with--suffix.Example table of conversionchar,name,replacement,codepoint,mufidecode
ī,LATIN SMALL LETTER I WITH MACRON,ĩ,012B,i
ı,LATIN SMALL LETTER DOTLESS I,i,0131,i
ﬀ,LATIN SMALL LIGATURE FF,ff,FB00,ff
A,LATIN CAPITAL LETTER A,A,0041,A
B,LATIN CAPITAL LETTER B,B,0042,B
C,LATIN CAPITAL LETTER C,C,0043,C
D,LATIN CAPITAL LETTER D,D,0044,DAs table:charnamereplacementcodepointmufidecodeīLATIN SMALL LETTER I WITH MACRONĩ012BiıLATIN SMALL LETTER DOTLESS Ii0131iﬀLATIN SMALL LIGATURE FFffFB00ffALATIN CAPITAL LETTER AA0041ABLATIN CAPITAL LETTER BB0042BCLATIN CAPITAL LETTER CC0043CDLATIN CAPITAL LETTER DD0044DGithub Action TemplateJust replace the path totable.csvand the file that needs to be tested, then save this file on your repository in.github/workflows/chocomufin.yml:# This workflow will install Python dependencies, run tests and lint with a single version of Python# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actionsname:ChocoMufinon:[push,pull_request]jobs:test:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v2-name:Set up Python 3.8uses:actions/setup-python@v2with:python-version:3.8-name:Install dependenciesrun:|python -m pip install --upgrade pippip install chocomufin-name:Run ChocoMufinrun:|chocomufin control table.csv **/*.xmlLogo byAlix Chagué.The fileoriginal_mufi_json's content is underCC BY-SA 4.0and comes fromhttps://mufi.info/m.php?p=mufiexport
Package: chocs
ChocsChocs is a modern HTTP framework for building AWS HTTP API/REST API and WSGI compatible applications.
Chocs aims to be small, expressive, and robust.
It provides an elegant API for writing fault-proof, extensible microservices.FeaturesAWS Serverless integrationElegant and easy APINo additional bloat like built-in template engines, session handlers, etc.Compatible with all WSGI serversLoosely coupled components which can be used separatelyMultipart body parsingGraceful error handlingHTTP middleware supportFast routingMiddleware packages to simplify daily tasksInstallationpip install chocsor with poetrypoetry add chocsQuick startimportchocshttp=chocs.Application()@http.get("/hello/{name}")defhello(request:chocs.HttpRequest)->chocs.HttpResponse:returnchocs.HttpResponse(f"Hello{request.path_parameters.get('name')}!")chocs.serve(http)Keep in mind that thechocs.serve()function is using thebjoernpackage, so make sure you included it in your project
dependencies before using it. You are able to use any WSGI compatible server.Available middlewaresOpenAPI Integration middlewareAllows integrating OpenAPI documentation into your codebase, providing automating request validation based
on your OpenAPI spec. More details are available in thechocs-openapi repository.ParsedBody middlewareParsed body middleware helps to convert json/yaml request payloads into dataclass, this not only makes your
daily tasks easier but increases readability of your code and contract. More details are available in thechocs-parsed-body repository.DocumentationFor usage and detailed documentation please visit ourwiki page
Package: chocs-middleware.parsed-body
Chocs - Parsed body middlewareParsed body middleware for chocs package.Parsed body middleware helps to convert json/yaml request payloads into dataclass. Parsed body middleware is build on
the top ofchilipackage. It supports complex dataclass initialisation and extraction
and does not pollute your codebase as it is solely depends on built-in python dataclasses package.InstallationWith pip,pipinstallchocs-middleware.parsed_bodyor through poetrypoetryaddchocs-middleware.parsed_bodyUsageMiddleware can work in two ways:strict modeauto hydrationInstrictmode middleware will only rely on defined initializer defined in your dataclasses. If arguments in request
payload are not exactly matching singnature of your initializer method it will fail.Inauto hydrationmode middleware will ignore initializers defined in your dataclasses, but__post_init__is still
called after data is hydrated into class. Auto hydration may fail in scenarios where property is defined as non-optional
and is missing in the request payload.Registering middlewarefromchocs_middleware.parsed_bodyimportParsedBodyMiddlewarefromchocsimportApplication,HttpRequest,HttpResponsefromchiliimportasdictfromdataclassesimportdataclassimportjson# You can define whether to use strict mode or not for all defined routes.app=Application(ParsedBodyMiddleware(strict=False))@dataclassclassPet:id:strname:str@app.post("/pets",parsed_body=Pet,strict=True)# you can also override default strict mode inside the routedefcreate_pet(request:HttpRequest)->HttpResponse:# You can try to catch exceptions while hydration happenstry:pet:Pet=request.parsed_bodyexceptException:pet=Noneassertisinstance(pet,Pet)returnHttpResponse(json.dumps(asdict(pet)))In the above example we can see thatrequest.parsed_bodyis no longer carryingchocs.JsonHttpMessageinstead it was transformed into dataclass hinted inside the route definition (Pet).Strict modeStrict mode is using initializer defined in a dataclass. Which means the request data
is simply unpacked and passed to your dataclass, so you have to manually transform
nested data to dataclasses in order to conform your dataclass interface, for example:fromchocs_middleware.parsed_bodyimportParsedBodyMiddlewarefromchocsimportApplication,HttpRequest,HttpResponsefromdataclassesimportdataclassfromtypingimportListapp=Application(ParsedBodyMiddleware())@dataclassclassTag:name:strid:str@dataclassclassPet:id:strname:strage:inttags:List[Tag]def__post_init__(self):# post init might be used to reformat your dataself.age=int(self.age)tmp_tags=self.tagsself.tags=[]fortagintmp_tags:self.tags.append(Tag(**tag))@app.post("/pets",parsed_body=Pet)defcreate_pet(request:HttpRequest)->HttpResponse:pet:Pet=request.parsed_bodyassertisinstance(pet.tags[0],Tag)assertisinstance(pet,Pet)returnHttpResponse(pet.name)Auto hydrationIn non-strict mode instantiating and hydrating your dataclasses happens automatically. Complex and deeply nested
structures are supported as long as used types are supported bychilihydration mechanism.List of supported types can be found inchili's supported data typesNote:post_initmethod is also called as a part of hydration process.
Package: chocs-middleware.xray
chocs-aws-xrayAWS X-Ray middleware for chocs library.Installationthrough poetry:poetryaddchocs_middleware.xrayor through pip:pipinstallchocs_middleware.xrayUsageThe following snippet is the simplest integration example.Please note x-ray won't work in WSGI mode, it has to be deployed as aws lambda in order to work.fromchocsimportApplication,HttpResponse,servefromchocs_middleware.xrayimportAwsXRayMiddlewareapp=Application(AwsXRayMiddleware())@app.get("/hello")defsay_hello(request):returnHttpResponse("Hello")serve(app)Setting up custom error handlerAWS X-Ray middleware provides a way to setup a custom error handler which may become handy when you
need to supplement your logs with additional information. Please consider the following example:fromchocsimportApplication,HttpResponse,HttpStatusfromchocs_middleware.xrayimportAwsXRayMiddlewaredeferror_handler(request,error,segment):segment.add_exception(error)returnHttpResponse("NOT OK",HttpStatus.INTERNAL_SERVER_ERROR)app=Application(AwsXRayMiddleware(error_handler=error_handler))@app.get("/hello")defsay_hello(request):raiseException("Not Today!")returnHttpResponse("Hello")To learn more about error_handler interface please clickhere.Accessing x-ray recorded from within your application layerfromchocsimportApplication,HttpResponsefromchocs_middleware.xrayimportAwsXRayMiddlewareapp=Application(AwsXRayMiddleware())@app.get("/hello")defsay_hello(request):xray_recorder=request.attributes["aws_xray_recorder"]# Here is the instance of your recorder.returnHttpResponse("OK")That's all.
Package: choice
Choice, a Python dialog library================================choice is a quick little library for getting user input in Python in a dialog-like fashion. Here's a little example:~~~import choice# Get a yes or no response (default is no)confirm = choice.Binary('Are you sure you want to delete?', False).ask()if confirm:deleteIt()# Input an arbitrary value, check for correctnesshowmany = choice.Input('How many pies?', int).ask()print("You ordered {} pies".format(howmany))# Choose from a set of optionsentree = choice.Menu(['steak', 'potatoes', 'eggplant']).ask()~~~choice automatically displays the best UI available to the user: basic text console, curses, or GUI windows. (curses and GUI are in development!)Requirements and Installation=============================For basic functionality, `choice` has no external dependencies, and requires only:* Python 2.7 or 3To install, just run:~~~pip install choice~~~Documentation=============API docs are coming soon. More in-depth documentation can be found on Github:https://github.com/fyhuang/choice/wiki
Package: choice-composer
Choice-composer:It will help you to make choice filed in Django or anywhere in python script according to your choices :smiley:Installationpip install choice-composerHow to use it?from choice_composer import Choice
# Write a class by extending Choice:
class UserRole(Choice):  
	ADMIN = 1  
	NORMAL_USER = 2  
	CLIENT = 3
# Let's see the how we can use it in django model:
class UserProfile(models.Model):  
	#......
	role = models.PositiveIntegerField(choices=UserRole.choices(), default=UserRole.NORMAL_USER)
	# If you want to get exact name of role then you can use property method by the following way:
	@property
	def user_role(self):
		return UserRole(self.role).name.title()***  If you want to filter data by specific role then you can use the following way:def role_wise_users(role=UserRole.CLIENT):
	# It returns all the client users from UserProfile model.
	users = UserProfile.objects.filter(role=role)
	return usersLicense© 2021 Imam Hossain RoniThis repository is licensed under the MIT license. See LICENSE for details.
Package: choicedesign
ChoiceDesignChoiceDesignis a Python package tool to construct D-efficient designs for Discrete Choice Experiments. ChoiceDesign combines enough flexibility to construct from simple 2-alternative designs with few attributes, to more complex settings that may involve conditions between attributes. ChoiceDesign is a revamped version ofEDT, a project I created some years ago for the same purpose. ChoiceDesign includes improvements over EDT such as class-based syntax, coding improvements, better documentation and making this package available to install viapip.NEW:ChoiceDesign now integratesBiogeme, which allows you to customise the utility functions.InstallationChoiceDesign is available to install via the regular syntax ofpip:python3 -m pip install choicedesignFeaturesThe main features of ChoiceDesign are:D-efficient designs based on a random swapping algorithmCustomisable utility functions(powered byBiogeme)Bayesian priors(experimental)Designs with conditions over different attribute levelsDesigns with blocks.Multiple stopping criteria (Fixed number of iterations, iterations without improvement or fixed time).ExamplesI provide some Jupyter notebooks that illustrate the use of ChoiceDesign in theexamples/folder of this repo.How to contribute?Any contributions to ChoiceDesign are welcome via this Git, or to my email joseignaciohernandezh at gmail dot com.DisclaimerThis software is provided for free and as it is, say withno warranty, and neither me nor my current institution is liable of any consequence of the use of it. In any case, integrity checks have been performed by comparing results with alternative software.ReferencesBierlaire, M. (2003). BIOGEME: A free package for the estimation of discrete choice models. InSwiss transport research conference.Kuhfeld, W. F. (2005). Experimental design, efficiency, coding, and choice designs.Marketing research methods in SAS: Experimental design, choice, conjoint, and graphical techniques, 47-97.Quan, W., Rose, J. M., Collins, A. T., & Bliemer, M. C. (2011). A comparison of algorithms for generating efficient choice experiments.
Package: choice_enum
Wrapper class for defining DRY, encapsulated choice options for CharFields.ChoiceEnumerationChoiceEnumerationclass can be declared at the module or class level in
the following format:class ChoiceClass(ChoiceEnumeration):
    ATTR1 = ChoiceEnumeration.Option('db_value1', 'Human readable text 1')
    ATTR2 = ChoiceEnumeration.Option('db_value2', 'Human readable text 2')The following attributes are generated on the ChoiceEnumeration child class:ALL_OPTIONS- a tuple of the supplied optionsCHOICES- a Django char field choices-compatible tupleCHOICES_DICT- a dictionary of option:text valuesDEFAULT- (optional) the item marked as defaultA typical Django example would look like:class SomeModel(models.Model):
    class MetaVar(ChoiceEnumeration):
        FOO  = ChoiceEnumeration.Option('foo',  'Foo Choice', default=True)
        BAR  = ChoiceEnumeration.Option('bar',  'Bar Option')
        BAZ  = ChoiceEnumeration.Option('baz',  'Baz Pick')
        SPAM = ChoiceEnumeration.Option('spam', 'Spam spam spam')
        EGGS = ChoiceEnumeration.Option('eggs', 'Eggs, Spam, and Ham')Example interactive usage::>>> class MetaVar(ChoiceEnumeration):
...     FOO  = ChoiceEnumeration.Option('foo',  'Foo Choice', default=True)
...     BAR  = ChoiceEnumeration.Option('bar',  'Bar Option')
...     BAZ  = ChoiceEnumeration.Option('baz',  'Baz Pick')
...     SPAM = ChoiceEnumeration.Option('spam', 'Spam spam spam')
...     EGGS = ChoiceEnumeration.Option('eggs', 'Eggs, Spam, and Ham')
>>> MetaVar.FOO
u'foo'
>>> MetaVar.ALL_OPTIONS
(u'foo', u'bar', u'baz', u'spam', u'eggs')
>>> MetaVar.CHOICES
((u'foo', 'Foo Choice'), (u'bar', 'Bar Option'), (u'baz', 'Baz Pick'), (u'spam', 'Spam spam spam'), (u'eggs', 'Eggs, Spam, and Ham'))
>>> MetaVar.CHOICES_DICT
{u'baz': 'Baz Pick', u'eggs': 'Eggs, Spam, and Ham', u'foo': 'Foo Choice', u'bar': 'Bar Option', u'spam': 'Spam spam spam'}
>>> MetaVar.DEFAULT
u'foo'
>>> MetaVar.CHOICES_DICT[MetaVar.FOO]
'Foo Choice'make_enum_classmake_enum_classdynamically generates aChoiceEnumerationderived class.Example:from choice_enum import make_enum_class, Option
MetaVar = make_enum_class('MetaVar',
    FOO=Option('foo',  'Foo Choice', default=True),
    BAR=Option('bar',  'Bar Option'),
    BAZ=Option('baz',  'Baz Pick')
)
Package: choicemodels
[![Build Status](https://travis-ci.org/UDST/choicemodels.svg?branch=master)](https://travis-ci.org/UDST/choicemodels)
[![Coverage Status](https://coveralls.io/repos/github/UDST/choicemodels/badge.svg?branch=master)](https://coveralls.io/github/UDST/choicemodels?branch=master)
[![Docs Status](https://readthedocs.org/projects/choicemodels/badge/?version=latest)](https://choicemodels.readthedocs.io)# ChoiceModelsChoiceModels is a Python library for discrete choice modeling, with utilities for sampling, simulation, and other ancillary tasks. It’s part of the [Urban Data Science Toolkit](https://docs.udst.org) (UDST).### FeaturesThe library currently focuses on tools to help integrate discrete choice models into larger workflows, drawing on other packages such as the excellent [PyLogit](https://github.com/timothyb0912/pylogit) for most estimation of models.ChoiceModels can automate the creation of choice tables for estimation or simulation, using uniform or weighted random sampling of alternatives, as well as interaction terms or cartesian merges.It also provides general-purpose tools for Monte Carlo simulation of choices given probability distributions from fitted models, with fast algorithms for independent or capacity-constrained choices.ChoiceModels includes a custom engine for Multinomial Logit estimation that’s optimized for fast performance with large numbers of alternatives.### InstallationChoiceModels can be installed using the Pip or Conda package managers:` pip install choicemodels `` conda install choicemodels--channelconda-forge`### DocumentationSee the online documentation for much more:https://choicemodels.readthedocs.ioSome additional documentation is available within the repo inCHANGELOG.md,CONTRIBUTING.md,/docs/README.md, and/tests/README.md.There’s discussion of current and planned features in the [Pull requests](https://github.com/udst/choicemodels/pulls?utf8=✓&q=is%3Apr) and [Issues](https://github.com/udst/choicemodels/issues?utf8=✓&q=is%3Aissue), both open and closed.
Package: choices
ThePDistis designed to make it easy to make it easy to make
things happen in a probablistic manner. Provide keys with an
associated probability attached, and then call the resulting
object when you need a new value.>>> mood = PDist({'happy': 0.3, 'neutral': 0.6, 'sad': 0.1})
>>> mood()
'happy'
>>> mood()
'neutral'You can retrieve the distribution of how those values are applied
by accessing thePDist.distributionattribute:>>> mood.distribution
[('happy', 0.3), ('neutral', 0.6), ('sad', 0.1)]As well as providing a dict to assign probabilities, you can
send in a list of lists/tuples. This allows for for non-hashable
types to be used. This means that you provide objects such as
functions to be used as keys:>>> def grumpy(news):
...    return ':/'
>>> def happy(news):
...    return ':)'
>>> react = PDist([(grumpy, 0.7), (happy, 0.3)])
>>> reaction = react()
>>> reaction("We're getting married!")
':/'You are not restricted to adding your input variables up to 1. For
example, if you only have a tally chart, and wish to calculate a probability distribution from that sample, you can provide that too:>>> spotted = {'geese': 0, 'ducks': 12, 'sparrows': 4, 'other': 39}
>>> bird_pdist = PDist(spotted)
>>> bird_pdist.distribution
[('geese', 0.0), ('sparrows', 0.07272727272727272), ('ducks', 0.21818181818181817), ('other', 0.7090909090909091)]Retrieving the probability of a particular key is supported. However,
the search strategy is very inefficient and probably shouldn’t be used
outside of the interactive Python shell.>>> bird_pdist['geese']
0.0
Package: choice-sort-pack
Р—Р°РїСѓСЃС‚РёС‚СЊ С‚РµСЃС‚:python -m choice_sort_package -tР—Р°РїСѓСЃС‚РёС‚СЊ РґРѕРєС‚РµСЃС‚:python -m choice_sort_package -dР—Р°РїСѓСЃС‚РёС‚СЊ РїСЂРѕРіСЂР°РјРјСѓ:python -m choice_sort_package ‘massive’s elements’
Package: choices.py
choices.pychoices.py is a wrapper around Django's choices to make them easier to use.Examplefromdjango.dbimportmodelsfromchoicesimportChoicesclassStudent(models.Model):classYear(Choices):FRESHMAN='FR'SOPHOMORE='SO'JUNIOR='JR'SENIOR='SR'@propertydefis_upperclass(self):returnselfin(self.JUNIOR,self.SENIOR)year_in_school=models.CharField(max_length=2,choices=Year.choices(),default=Year.FRESHMAN.value)defis_upperclass(self):returnself.Year(self.year_in_school).is_upperclassInstallingInstall it fromPyPIwith pip:pip install choices.pyRequirements:Python 3.4+
Package: choicetypes
Python Choice Typeschoicetypesbrings powerful and simple algebraicsum typesto Python.UsageNewChoicetypes are constructed using sytax similar to standard library enums and dataclasses:fromchoicetypesimportChoiceclassIpAddr(Choice):V4:tuple[int,int,int,int]V6:strhome=IpAddr(V4=(127,0,0,1))loopback=IpAddr(V6="::1")A choice consists of mutually exclusivevariants. In this example, any instance ofIpAddrmust beeitheraV4orV6address. Variants are just normal attributes and can be accessed as such. But they're also designed to work seamlessly withstructural pattern matching, introduced in Python 3.10:foripin(home,loopback):matchip:caseIpAddr(V4=fields):print("{}:{}:{}:{}".format(*fields))caseIpAddr(V6=text):print(text)For a complete overview of whatChoicetype can do, see theofficial documentation.InstallationThechoicetypespackage is available on PyPi:pipinstallchoicetypesIt is written in pure Python with zero dependencies and tested against Python 3.7 and newer.BackgroundAlgebraic choice types have various other names (sum types, tagged unions, etc.) and exist in a number of programming languages. The primary inspiration forchoicetypeswas Rust'sEnum type.Python'sEnumallows you to express mutually exclusive variants, but not associated data. Itsdataclass(and similar) types store data but cannot represent mutually exclusive variants. The core idea behind algebraic sum types is to store these two pieces of information simultaneously.I wanted to build a type that could accomplish this in a similar style to Rust. Importantly, it had to work cleanly with structural pattern matching and type hinting.
Package: choirless-smiler
SmilerThis is a library and CLI tool to extract the "smiliest" of frame from a video of people.It was developed as part ofChoirlessas part ofIBM Call for code.Installation% pip install choirless_smilerUsageSimple usage:% smiler video.mp4 snapshot.jpgIt will do a pre-scan to determine the 5% most changed frames from their previous frame
in order to just consider them. If you know the threshold of change you want to use you
can use that. e.g.The first time smiler runs it will download facial landmark data and store it in~/.smilerlocation of this data and cache directory can be specified as arguments% smiler video.mp4 snapshot.jpg --threshold 480000Help% smiler -h
usage: smiler [-h] [--verbose] [--threshold THRESHOLD]
              [--landmarks-url LANDMARKS_URL] [--cache-dir CACHE_DIR]
              [--quantile QUANTILE]
              video_fn image_fn

Save thumbnail of smiliest frame in video

positional arguments:
  video_fn              filename for video to analyse
  image_fn              filename for output thumbnail

optional arguments:
  -h, --help            show this help message and exit
  --verbose             verbose mode
  --threshold THRESHOLD
                        threshold of difference overwhich we analyse an image
  --landmarks-url LANDMARKS_URL
                        url of facial landmark file
  --cache-dir CACHE_DIR
                        local cache to store the landmark file in
  --quantile QUANTILE   quantile of images to analyseVerbose modeIf you specify the--verboseflag to the CLI then smiler will
print out a progress bar as it goes along to show you have it's doing.Use as a librarySmiler can be imported and used in a library. You are responsible
for supplying paths to the facial landmark data and model, but
help functions in the module can help.fromchoirless_smiler.smilerimportSmiler,load_landmarkslandmarks_path=load_landmarks(landmarks_url,cache_dir)smiler=Smiler(landmarks_path,model_path)fg=smiler.frame_generator(video_fn)threshold=smiler.calc_threshold(fg,quantile)fg=smiler.frame_generator(video_fn)ffg=smiler.filter_frames(fg,threshold)smile_score,image=smiler.find_smiliest_frame(ffg)Re-trainingThere are some scripts in thescriptsdirectory in theGithub repoto generate new images and to aid manual classification
and retraining of the model.