Saravanan666/pypi-org huggingface dataset:
Package: cfed
Categorical Features Pairwise Euclidean DistancesA python package to compute pairwise Euclidean distances on datasets with categorical features in little timeMotivationIn machine learning model development I often ran into datasets with categorical features. Most times dealing with these categorical features was fairly straight forward (I would use the pandas get_dummies() function to convert each feature into a one-hot-encoded representaion).But when the number of categories embedded in these categorical features became massive, I ran into the problem of extremely slow Euclidean distance computation between each sample and every other sample.This is where this package comes in. Running my own tests, I concluded that this code runs significantly faster than theSKLearn pairwise Euclidean distances functionon one-hot-encoded categorical features.PrerequisitesSeerequirements.txtfor the full list of Prerequisite libraries.InstallationTo start using this package, simply run this command in terminalpip install cfedUsageimport pandas as pd
from cfed.pairwise import euclidean_distances
from cfed.pairwise import euclidean_distances_from_split

df1 = pd.DataFrame.from_dict({
    'col1': [1, 2, 3],
    'col2': [4, 5, 6],
    'col3': [7, 8, 9]
})
df2 = pd.DataFrame.from_dict({
    'col1': [1, 4, 7],
    'col2': [2, 5, 8],
    'col3': [3, 6, 9],
})

distances = euclidean_distances(df1, df2, categorical_columns=['col1'])Or without specifyingcategorical_columnsimport pandas as pd
from cfed.pairwise import euclidean_distances
from cfed.pairwise import euclidean_distances_from_split

df1 = pd.DataFrame.from_dict({
    'col1': ['c1', 'c2', 'c1'],
    'col2': [4, 5, 6],
    'col3': [7, 8, 9]
})
df2 = pd.DataFrame.from_dict({
    'col1': ['c1', 'c3', 'c2'],
    'col2': [2, 5, 8],
    'col3': [3, 6, 9],
})

distances = euclidean_distances(df1, df2)Orimport pandas as pd
from cfed.pairwise import euclidean_distances
from cfed.pairwise import euclidean_distances_from_split

df1_numerical = pd.DataFrame.from_dict({
    'col1': [1, 2, 3],
    'col2': [4, 5, 6],
    'col3': [7, 8, 9]
})
df2_numerical = pd.DataFrame.from_dict({
    'col1': [1, 4, 7],
    'col2': [2, 5, 8],
    'col3': [3, 6, 9],
})

df1_categorical = pd.DataFrame.from_dict({
    'col4': ['c1', 'c1', 'c2'],
})
df2_categorical = pd.DataFrame.from_dict({
    'col4': ['c1', 'c2', 'c2'],
})

distances = euclidean_distances_from_split(df1_numerical, df1_categorical, df2_numerical, df2_categorical)
Package: cfel-pylint-checkers
cfel-pylint-checkersInstallationJustpip install cfel-pylint-checkersshould suffice. Then you can enable the appropriate checkers as plugins by editing your.pylintrcfile, extending theload-pluginsline. For example:load-plugins=cfel_pylint_checkers.no_direct_dict_access,cfel_pylint_checkers.tango_command_dtypeCheckersno-direct-dict-accessEnable with:load-plugins=cfel_pylint_checkers.no_direct_dict_accessThis disallows the use of dictionary access using the[]operatorfor reading. Meaning, this is no longer allowed:mydict={"foo":3}print(mydict["bar"])As you can see, this code produces an error, since we’re accessing"bar"but themydictdictionary only contains the key"foo". You have to use.getto make this safe:mydict={"foo":3}print(mydict.get("bar"))Which producesNoneif the key doesn’t exist. You can even specify a default value:mydict={"foo":3}print(mydict.get("bar",0))Mutating use ofoperator[]is, of course, still possible. This isfine:mydict={"foo":3}mydict["bar"]=4tango-command-dtypeEnable with:load-plugins=cfel_pylint_checkers.tango_command_dtypeThis checker tests for various error conditions related to the hardware controls systemTango, specifically its Python adaptationPyTango.For instance, the following mismatch between thedtype_inof a command and its actual type annotation is caught:fromtango.serverimportDevice,commandclassMyDevice(Device):@command(dtype_in=int)defmycommand(self,argument:str)->None:pass
Package: cfelpyutils
# The CFELPyUtils Library## IntroductionCFELPyUtils is a utility library written in Python and developed at the Center For Free
Electron Laser Science (CFEL) in Hamburg. It contains several functions and classes
that perform various tasks related to the processing of x-ray imaging data. It is used by
several internal and released CFEL software projects.### FeaturesRead and apply geometry information to x-ray detector datapeak finding algorithm (new in v2.0)calibration tool for the AGIPD 1M detector (new in v2.0)module for reading [CrystFEL](https://www.desy.de/~twhite/crystfel/) streams (new in v2.0)Please see the [migration guide](#migration-guide) below before upgrading from CFELPyUtils 0.x or 1.x.## InstallationThe CFELPyUtils library is available on the [Python Package Index](https://pypi.org/)
(PyPI). It can be installed using the ‘pip’ command:pip install cfelpyutilsFor Python 2, please use the 1.0 version.pip install cfelpyutils==1.0.1The library can also be installed manually by checking out this repository and running:python setup.py install### Migration GuideThe following table lists functions for which the module affiliation has changes in v2.0.
Please replace all old occurances with the new ones.cfelpyutils-0.x,-1.x|cfelpytuils-2|———————- | ————— |geometry_utils.compute_pix_maps()|geometry.compute_pix_maps()|geometry_utils.compute_visualization_pix_maps()|geometry.compute_visualization_pix_maps()|geometry_utils.apply_geometry_to_data()|geometry.apply_geometry_to_data()|crystfel_utils.load_crystfel_geometry()|geometry.load_crystfel_geometry()|Please note thatgeometry.load_crystfel_geometry()now returns a namedtuple ofgeometry.CrystFELGeometry.
Previously it returned only ageometry.TypeDetector.
This is not the first element of the tuple.If your code did this before`python from cfelpyutils.crystfel_utils import load_crystfel_geometry geometry = load_crystfel_geometry(path_to_geometry_file) `it needs to be changed to something like`python from cfelpyutils.geometry import load_crystfel_geometry geometry_tuple = load_crystfel_geometry(path_to_geometry_file) geometry = geometry_tuple.detector `or`python from cfelpyutils.geometry import load_crystfel_geometry geometry_tuple = cfelpyutils.geometry.load_crystfel_geometry(path_to_geometry_file) geometry = geometry_tuple[0] `## ContributorsThe CFELPyUtils library is currently developed in the lab of
[Henry Chapman](https://cid.cfel.de/) at the Center For Free Electron Laser Science
in Hamburg.Many people from different institutions worlwide contribute code, testing and support
to the project:Valerio MarianiAnton BartyAndrew MorganThomas A. WhiteThomas KluyverPhilipp MiddendorfLuca GelisioFlorian LauckIf you have any questions or want to contribute, please [contact us](mailto:sc@cfel.de).## DocumentationDocumentation for the CFELPyUtils is available
on [GitLab at DESY](https://cfel-sc-public.pages.desy.de/cfelpyutils/) and
in the [docs/](docs) of the [repository](https://gitlab.desy.de/cfel-sc-public/cfelpyutils).## Source CodeThe source code of the CFELPyUtils library can be found on the DESY GitLab instance:https://gitlab.desy.de/cfel-sc-public/cfelpyutils
Package: cfenv
py-cfenvis a tiny utility that simplifies interactions with Cloud Foundry environment variables, modeled afternode-cfenv.QuickstartfromcfenvimportAppEnvenv=AppEnv()env.name# 'test-app'env.port# 5000redis=env.get_service(label='redis')redis.credentials# {'uri': '...', 'password': '...'}redis.get_url(host='hostname',password='password',port='port')# redis://pass:hostKeys may change based on the service. To see what keys are available for the app’s services:$cfenvmy-appGettingenvvariablesforappmy-appinorgmy-org/spacemy-spaceasme@example.com...OKSystem-Provided:{"VCAP_SERVICES":{"redis":[{"credentials":{"hostname":"example.redis.host","password":"verysecurepassword","port":"30773","ports":{"6379/tcp":"30773"},"uri":"redis://:verysecurepassword@example.redis.host:30773"},"label":"redis","name":"example-redis","plan":"standard","provider":null,"syslog_drain_url":null,"tags":["redis28","redis"],"volume_mounts":[]}]}}
Package: cf_extension_core
SummaryHelper to enable all types of resource types for create/update/read/list operationsHeavily inspired to use dynamodb for resource management.  Supports all native create/read/update/list/delete operations for any resource.Dynamic identifier generation to support any resource identifier use case.  Read Only resources or real resource creation.Required extra permissions in each handlers permissions:Due to us using dynamodb as a backend, we need extra permissions to store/retrieve state information from dynamo.  These permissions should be added in addition to any other required permissions by each handler.dynamodb:CreateTabledynamodb:PutItemdynamodb:DeleteItemdynamodb:GetItemdynamodb:UpdateItemdynamodb:UpdateTabledynamodb:DescribeTabledynamodb:ScanDevelopmentHigh level commandscurl -sSL https://install.python-poetry.org | python3 -
 export PATH="~/.local/bin:$PATH"
 poetry --version
 poetry add boto3

 poetry add --group dev  pytest

 poetry install --no-root
 poetry build
 poetry config pypi-token.pypi ""
 poetry publishGenerating Stubs after all 3rd party stubs are installedfind src/ -type f -name '*.pyi' -exec rm {} +
stubgen src/ -o src/  --include-privateDo not run again after manually changed.Build system updated to validate stubs viastubtest
Package: cff
cffcffis a Python package for bootstrapping Amazon Web ServicesCloudFront Lambda@EdgeFunctions.If you agree with the package's opinions then your functions become as simple as a single line:fromcff.origin_requestimporthandlerRead the full documentation atcariad.github.io/cff.👋 Hello!Hello!I'mCariad Ecclestonand I'm an independent/freelance software engineer. If my work has value to you, please considersponsoring.If you ever raise a bug, request a feature or ask a question then mention that you're a sponsor and I'll respond as a priority. Thank you!
Package: cff2pages
cff2pagesMotivationThe Citation.cff is a fantastic format that combines human-readable and machine-readable metadata
about its repository. It provides linking systems with important metadata about the
presented project and gives people the ability to reference the project, among other things.
However, for a wide range of users, the YAML file format can seem intimidating, whereas a clean
website is generally more readable. This project aims to automate the conversion of cff files,
so that maintaining the cff file pays off for developers in terms of the project's presentation,
thereby ensuring that the website representation is retained.Project Descriptioncff2pages is envisioned as a Python package, designed to automate the extraction of metadata from
your project's Citation.cff file, and swiftly generate a sleek, static HTML page. This versatile
page can serve as a vivid representation of your project on Github/Gitlab Pages.Usagecd project_folder
pip install cff2pages
cff2pagesGitlab CI Runnerstages:-Pagespages:stage:Pagesimage:python:3.11script:-python -m pip install cff2pages-cff2pagesartifacts:paths:-publicGithub Workflowdeploy:environment:name:github-pagesurl:${{ steps.deployment.outputs.page_url }}runs-on:ubuntu-lateststeps:-name:Checkoutuses:actions/checkout@v3-name:Set up Python 3.11uses:actions/setup-python@v3with:python-version:3.11-name:Install dependenciesrun:|python -m pip install --upgrade pippip install cff2pagescff2pages-name:Setup Pagesuses:actions/configure-pages@v3-name:Upload artifactuses:actions/upload-pages-artifact@v2with:path:'./public'-name:Deploy to GitHub Pagesid:deploymentuses:actions/deploy-pages@v2Roadmap0.0.1 version in pypiconvert all cff-attributesabstractauthorscff-versioncommitcontactdatedoiidentifiersdoiswhurlkeywordslicenselicense-urlmessagepreferred-citationreferences (new, but not published!)repositoryrepository-artifactrepository-codetitletypeurlversionsimple conversion from cff to htmlworking samples for GitHub and gitlabintegrate cff2pages into given htmlchange styles
Package: cffconvert
cffconvertCommand line program to validate and convertCITATION.cfffiles.Supported input versions of the Citation File Format:Citation File Format schema versionLink to Zenodo release1.2.01.1.01.0.31.0.21.0.1Supported output formats:APA-like plaintextBibTeXCodeMetaEndNoteRISschema.org JSONZenodo JSONcffconvertdoes not support converting items fromreferencesorpreferred-citationkeys at the moment.InstallingTo install in user space,python3-mpipinstall--usercffconvertEnsure that the user space directory~/.local/bin/is on thePATH.whichcffconvertshould now return the location of the program.Seedocs/alternative-install-options.mdfor alternative install options.Command line interfaceSeecffconvert's options:cffconvert--helpShows:Usage:cffconvert[OPTIONS]Options:-i,--infilePATHPathtotheCITATION.cffinputfile.Ifthisoptionisomitted,'./CITATION.cff'isused.-o,--outfilePATHPathtotheoutputfile.-f,--format[apalike|bibtex|cff|codemeta|endnote|ris|schema.org|zenodo]Outputformat.-u,--urlTEXTURLtotheCITATION.cffinputfile.-h,--helpShowhelpandexit.--show-traceShowerrortrace.--validateValidatetheCITATION.cfffileandexit.--versionPrintversionandexit.Example usageValidating a local CITATION.cff filecffconvert--validate
cffconvert--validate-iCITATION.cff
cffconvert--validate-i${PWD}/CITATION.cff
cffconvert--validate-i../some-other-dir/CITATION.cffValidating a remote CITATION.cff filecffconvert--validate--urlhttps://github.com/<org>/<repo>
cffconvert--validate--urlhttps://github.com/<org>/<repo>/commit/<sha>
cffconvert--validate--urlhttps://github.com/<org>/<repo>/tree/<sha>
cffconvert--validate--urlhttps://github.com/<org>/<repo>/tree/<tag>
cffconvert--validate--urlhttps://github.com/<org>/<repo>/tree/<branch>Converting metadata to other formatsIf there is a validCITATION.cfffile in the current directory, you can convert to various other formats and
print the result on standard out with:cffconvert-fbibtex
cffconvert-fcodemeta
cffconvert-fendnote
cffconvert-fris
cffconvert-fschema.org
cffconvert-fzenodo
cffconvert-fapalikeWriting to a file# with i/o redirection:cffconvert-fbibtex>bibtex.bib
cffconvert-fzenodo>zenodo.json
cffconvert-fendnote>${PWD}/endnote.enw# etc# without i/o redirectioncffconvert-fbibtex-obibtex.bib
cffconvert-fzenodo-ozenodo.json
cffconvert-fendnote-o${PWD}/endnote.enw# etc
Package: cff-from-621
cff-from-621This tool derives aCITATION.cfffile from a Python project'spyproject.tomlcontents that providePEP-621compliant package metadata.FeaturesAdditional and overriding values can be provided statically or via Python
string templates.Order of the resulting fields can be defined, has a non-arbitrary default.Dynamic fields are resolved for thesetuptoolsbuild backend.ExampleGiven apyproject.tomlthat includes these contents:[build-system]requires=["setuptools"]build-backend="setuptools.build_meta"[project]name="cff-from-621"description="Generates metadata in the Citation File Format for Python projects from their PEP-621 compliant package definition. Includes a CLI."keywords=["PEP-621","CFF","conversion"]authors=[{name="Frank Sachsenheim"}]dynamic=["version"][tool.cff-from-621]order=["message","cff-version","title","abstract","version","date-released","authors","keywords"][tool.cff-from-621.static]date-released="2022-09-18"message="🔥🌍🔥"[tool.setuptools.dynamic]version={attr="cff_from_621.version.VERSION"}cff-from-621would derive thisCITATION.cff:---message:🔥🌍🔥cff-version:1.2.0title:cff-from-621abstract:Generates metadata in the Citation File Format for Python projects fromtheir PEP-621 compliant package definition. Includes a CLI.version:0.0.1date-released:'2022-09-18'authors:-name:Frank Sachsenheimkeywords:-PEP-621-CFF-conversiontype:software...InstallationAddcff-from-621with your environment management or install it globally
withpipx:$ pipx install cff-from-621UsageChange into your project's root folder and jump right in with:$ cff-from-621The usage details can be explored with:$ cff-from-621 --helpCaveatsAuthors / maintainers are represented asentity typebecause their PEP-621 representation can't be parsed into the atomicity of theperson type.DevelopmentThis tool isn't supposed to cover each and every corner case that may exist.
Its implementation shall be kept simple and may be used as library for custom
extensions and alterations.
All contributions within that frame are welcome.In a virtual environment that you set up for development, install this package
from source in editable mode and required development tools:$ pip install .[development]Make use of or refer to the accompanyingjustfileto
run common development tasks.
Package: cfficloak
cfficloak - A simple but flexible module for creating object-oriented, pythonic CFFI wrappers.
This is an extension of cffiwrap fromhttps://bitbucket.org/memotype/cffiwrapThe intention is to more fully wrap/hide binary extensions build with cffi to improve auto-completion, inspection of objects and reading/writing/copying/assigning to c objects, especially structs and unions.
Wrapped functions provide a number of auto-conversion to/from types with error handling and output pointer argument creation.
Function skeletons can provide python definitions of c functions to improve auto-compiletion in python code and declaration of out args, error checking and default arguments.
Structs can take numpy arrays assigned to array elements and handle two-way linking for you without any copies.
There are a number of other utilities and wrappers provided to simpliy usage of cffi modules in day-to-day coding.Install with
# pip install cfficloakAutomatic documentation is here:http://cfficloak.readthedocs.org/Copyright (c) 2017, Andrew Leech <andrew@alelec.net>Original cffiwrap copyright (c) 2013, Isaac Freeman <memotype@gmail.com>
All rights reserved.Licensed under Apache License, Version 2.0.
See LICENSE.txt for licensing details.version: 2.7
Package: cffi_magic
CFFI magicQuick iteration of cffi in notebooks.%%cffiintquint(int);intquint(intn){return5*n;}# quint(9) # 45rust magicIf you have rust installed:%%rustintdouble(int);#[no_mangle]pubexternfndouble(x:i32)->i32{x*2}# double(6) # 12
Package: cffi_re2
# cffi_re2[![Build Status](https://travis-ci.org/vls/cffi_re2.png)](https://travis-ci.org/vls/cffi_re2)cffi_re2 is a cffi-based high-level Python binding for Google's [re2](https://github.com/google/re2) library.### InstallationBefore installing cffi_re2, you will need to install re2. On Ubuntu/Debian you can do that using```bashsudo apt-get install libre2-dev```Else, you can simply install the current version from the git repository:```bashgit clone https://github.com/google/re2.gitmakemake testsudo make install```See the [re2 repository](https://github.com/google/re2) for further information.After installing re2, you can install cffi_re2:```bashpip install cffi_re2```or from a local copy:```bashsudo python setup.py install```*cffi_re2* is fully compatbile with both *Python3.x* as well as [*PyPy*](pypy.org) (including *PyPy3*).You can run the unit tests using:```bashsudo python setup.py test```### Using cffi_re2*cffi_re2* is mostly compatible to the *re* module from the Python standard library and exposes the same interface. In almost all cases you can use the same source code for both libraries. The flags in `cffi_re2` are exactly the same as those in `re`, so you can e.g. use `re.IGNORECASE` in `cffi_re2.compile` and vice versa.One way to use *cffi_re2* is:```pythonimport cffi_re2 as re```Note however, that, due to the design of the [*RE2*](https://github.com/google/re2) library, some syntax elements like zero-width lookaheads or lookbehinds are [not supported](https://github.com/google/re2/wiki/Syntax).When using those syntax elements, the backend reports a syntax error when calling `cffi_re2.compile`, for example:```ValueError: invalid perl operator: (?<```One workaround is to convert your regex into a group-capturing form and select the appropriate group later. For larger sets of complex regular expressions, this is often not feasible, however.In this case, it is recommended to use a hybrid approach, i.e. falling back to *re* if *cffi_re2* fails to compile an expression.```pythonimport reimport cffi_re2def compileRegex(rgx, flags=0):try:return cffi_re2.compile(rgx, flags)except ValueError:return re.compile(rgx, flags)```Note that in the current implementation there are still several known and unknown incompatibilities between *cffi_re2* and *re*. If you encounter issues, please report them as a bug.### Benchmarks### About*cffi_re2* was originally developed by [Liang Zhaohao](https://github.com/vls). Many new features and improvements were contributed by [Uli Köhler](https://github.com/ulikoehler).The library is licensed under the MIT license (see LICENSE file).
Package: cffm
cffmConfiguratio ex Fontibus Multis - Configuration from many sourcesThe purpose of this library is to provide a flexible framework for
an application’s/library’s configuration:[x]Multiple sourceswith precedence, e.g. default values < config files < environmental variables[x] Static typing with documentation[x] Extension viaSections[ ] Source validation[ ] Autogenerate example config filesExample>>> from cffm import config, field, section
>>> @config
... class AppConfig:
...     loglevel: int = field(1, description="Loglevel")
...     @section('bar')
...     class BarConfig:
...          foo: int
...          baz: bool = False
Package: cfg2qr
Configure to QR-codeDescriptionThis is a personal demo to get familiar with  python structuring and packaging.Specify a config file in json or yaml format and a QR code will be generated using existing  PyPI library.Specify an existing QR code image and the output file name (json or yaml) and the config file will be generated using existing PyPI library.Generating QR code from config file--input_directory: specify input directoryencoder-input_text_name :
specify the config file name (with file format)-result_text_name : specify the output image file name (with file format). The resulting config file will be saved in the same directory as the inputGenerating config file from QR code--input_directory: specify input directorydecoder-input_image_name : specify the input image file name (with file format)-result_text_name :specify the output config file name. The resulting config file will be saved in the same directory as the input
Package: cfg-argparser
cfg_argparser 1.2.1a config wrapper I made.Installation# from pypi:pipinstallcfg-argparser# from github:gitclone"https://github.com/zeptofine/cfg-argparser"cdcfg-argparser
pipinstall-e.Examplefromcfg_argparserimportwrap_config,CfgDictcfg=CfgDict("test.json")@wrap_config(cfg)deftest_function(s:str,is_real:bool=True):# I'd advise only wrapping functions all having default methodsreturnf"{s}is{'real'ifis_realelse'fake'}"if__name__=="__main__":print(test_function("We"))cfg['s']="us"print(test_function())# Linters hate him!CompatibiltyThis was mainly tested on 3.9 and 3.10, but it should work from 3.6 onwards. i can't test earlier versions for some reason.