Saravanan666/pypi-org huggingface dataset:
Package: cyminiball
cyminiballA Python package to compute the smallest bounding ball of a point cloud in arbitrary dimensions. A Python/Cython binding of the popularminiballutility by Bernd Gärtner.To my knowledge, this is currently the fastest implementation available in Python. For other implementations see:miniballcppPython binding of the same C++ source (miniball)miniballPure Python implementation (slow)Installation:The package is available via pip.python-mpipinstallcyminiballUsage:importcyminiballasminiballimportnumpyasnpd=2# Number of dimensionsn=10000# Number of pointsdt=np.float64# Data typepoints=np.random.randn(n,d)points=points.astype(dt)C,r2=miniball.compute(points)print("Center:",C)print("Radius:",np.sqrt(r2))Additional output can be generated using thedetailsflag andcompute_max_chord().C,r2,info=miniball.compute(points,details=True)# Returns an info dict with the following keys:#       center:         center#       radius:         radius#       support:        indices of the support points#       relative_error: error measure realtive to r2#       is_valid:       numerical validity#       elapsed:        time required## The maximal chord is the longest line connecting any# two of the support points. The following extends the# info dict by the following keys:#       pts_max:        point coordinates of the two points#       ids_max:        ids of the two extreme points#       d_max:          length of the maximal chord(p1,p2),d_max=miniball.compute_max_chord(points,info=info)Seeexamples/examples.pyfor further usage examplesBuild packageBuilding the package requiresPython 3.xCythonnumpyFirst, download the project and set up the environment.gitclone"https://github.com/hirsch-lab/cyminiball.git"cdcyminiball
python-mpipinstall-r"requirements.txt"Then build and install the package. Run the tests/examples to verify the package../build_install.sh
python"tests/test_all.py"python"examples/examples.py"PerformanceFor a comparison withminiballcpp, run the below command. In my experiments, the Cython-optimized code ran 10-50 times faster, depending on the number of points and point dimensions.python"examples/comparison.py"
Package: cymmm
Vex MMMOpen source library for building Marketing Mix Models.Built for my own consulting projects andwww.vexpower.com.If you're new to MMM, learn by doing it in GSheets first (link).Feel free to use for commercial and non-commercial uses (MIT License).Contact me to contribute!https://twitter.com/hammer_mtContributions Needed:Weibull Adstocks (example)Media Optimization (example)Bayesian Hierarchical Models (example)
Package: cymod
A tool to support the description and development of state-and-transition
models using theCyphergraph query language.PurposeState-and-transition models (STMs) are valuable tools for capturing and
communicating qualitative ecological and geomorphic knowledge. However,
they can become unwieldy when the richness of the available qualitative
knowledge renders them difficult to represent in their entirety on a
2-dimensional surface.Cymod aims to simplify the development and use of detailed STMs by allowing
modellers to specify components of their models piecemeal in individual Cypher
files. Cymod can then to do the work of wiring these components together into a
complete model, stored in aNeo4jgraph database.Example usageHaving prepared a set of Cypher files specifying an STM in the./cypher-filesdirectory, a modeller can load those files into the graph
database with the following Python commands:fromcymodimportServerGraphLoader# Initialise a ServerGraphLoader object using your Neo4j credentialsgl=ServerGraphLoader(user="username",password="password")# Read cypher queries from files in cypher-files directorygl.load_cypher("cypher-files")# Run these queries against the graph specified in the neo4j# configuration filegl.commit()Supported Python versionsTested against Python 2.7, 3.5, 3.6, and 3.7.
Package: cymorph
CyMorph - non-parametric galaxy morphology packageUpdated and adjusted and repacked version of 1st CyMorph version:https://github.com/rsautter/CyMorph& Paulo Barchi workInstallationDependencies:pip install numpy scipy matplotlib seaborn sepCyMorph can be installed with:pip install cymorphDocumentationhttps://cymorph.readthedocs.io/Basic UsageConcentrationfrom cymorph.concentration import Concentration
c = Concentration(image, radius1, radius2) 
c.get_concentration()Asymmetryfrom cymorph.asymmetry import Asymmetry
a = Asymmetry(image) 
a.get_pearsonr()
a.get_spearmanr()
a.get_collected_points_plot()Smoothnessfrom cymorph.smoothness import Smoothness
s = Smoothness(clean_image, segmented_mask, smoothing_degradation, butterworth_order) 
s.get_pearsonr() 
s.get_spearmanr()
s.get_smoothed_image()
s.get_collected_points_plot()Entropyfrom cymorph.entropy import Entropy
e = Entropy(image, bins) 
e.get_entropy()G2from cymorph.g2 import G2
g2 = G2(g2_modular_tolerance, g2_phase_tolerance, g2_position_tolerance) 
g2.get_g2()
g2.get_gradient_plot()
g2.get_asymmetry_gradient_plot()ContributorsIgor KolesnikovVitor SampaioPaulo BarchiRubens Sautter
Package: cymove
cymoveThis package is DEPRECATED sincestd::movesupport ismergedto Cython and available as of v0.29.17 (2020-04-26).cymove is a header (pxd) only wrapper around C++11std::movefunction. It
allows using move semantics from cython code.Installationpip install cymoveExample Usageexample.pyx:# distutils: language = c++fromlibcpp.memorycimportmake_shared,shared_ptr,nullptrfromcymovecimportcymoveasmovecdefshared_ptr[int]ptr1,ptr2cdefint*raw_ptrptr1=make_shared[int](5)raw_ptr=ptr1.get()ptr2=move(ptr1)assertptr2.get()==raw_ptrassertptr1==nullptrprint("OK!")Compile & run:$cythonize-3-iexample.pyx$python3-c"import example"OK!
Package: cymr
cymrPackage for fitting and simulating free recall data. Includes a fast
implementation of the context maintenance and retrieval (CMR) model
using Cython.See thewebsitefor full
documentation.InstallationFor the latest stable version:pipinstallcymrTo get the development version:pipinstallgit+https://github.com/mortonne/cymrTo install for development, clone the repository and run:pythoninstall-e.This will set links to the package modules so that you can edit the
source code and have changes be reflected in your installation.QuickstartFit the context maintenance and retrieval model (CMR) to sample data:fromcymrimportfit,cmr# load sample datadata=fit.sample_data('Morton2013_mixed').query('subject <= 3')# define model weightsn_items=768param_def,patterns=cmr.config_loc_cmr(n_items)param_def.set_fixed(T=0.1,Lfc=0.15,Lcf=0.15,Afc=0,Acf=0,Dfc=0.85,Dcf=0.85,P1=0.2,P2=2,B_start=0.3,B_rec=0.9,X1=0.001,X2=0.25)param_def.set_free(B_enc=(0,1))# fit the model to sample datamodel=cmr.CMR()results=model.fit_indiv(data,param_def,patterns=patterns,tol=0.1)See thedocumentationfor details.Unit testsFirst, install extra packages needed for testing:pipinstall.[test]To run all tests (from the main repository directory)pytestBenchmarkTo run a speed benchmark test, first install snakeviz (pip install snakeviz).
To run likelihood calculation with a sample dataset and then display an html
report:./benchmark
Package: cymru-services
Python API to use Cymru services. This code is not supported nor endorsed by Cymru.Code licensed underhttp://www.gnu.org/licenses/gpl-3.0.txtServices by cymru :The Bogon ReferenceA bogon prefix is a route that should never appear in the Internet routing table. This can be for one of several reasons - either the prefix is within a private or reserved IP address block, or a block that has not yet been allocated to a Regional Internet Registry (RIR). The Bogon Reference pages provide a number of resources for the filtering of bogon prefixes from your routers and hosts. Check out the bogon reference for more details!The IP to ASN Mapping ProjectTeam Cymru provides a number of query interfaces that allow for the mapping of IP addresses to BGP prefixes and Autonomous System Numbers (ASNs), based on BGP feeds from our 50+ BGP peers, and updated every 4 hours. This data is available through traditional WHOIS (TCP 43), DNS (UDP 53), HTTP (TCP 80), and HTTPS (TCP 443). For more information on the data available, and how to query, check out our IP to ASN Mapping Project.The Malware Hash RegistryThe Malware Hash Registry provides the ability to perform lookups of MD5 and SHA-1 hashes of files to see if Team Cymru’s malware analysis system has classified them as malware, along with information about when the sample was last seen and an approximate anti-virus detection percentage. For more information on the data returned and how to query this system, check out the Malware Hash Registry.Seehttp://www.team-cymru.org/Services/for services documentation.
Seehttps://github.com/trolldbois/python-cymru-services/raw/master/READMEfor API documentation.
Package: cymysql
What’s CyMySQLThis package contains a python MySQL client library.It is a fork project from PyMySQLhttps://pymysql.readthedocs.io/en/latest/.CyMySQL accerarates by Cython, and support not only python 2 but also python 3.
It still can work without Cython as a pure python driver.Documentation on the MySQL client/server protocol can be found here:http://dev.mysql.com/doc/internals/en/client-server-protocol.htmlRequirementsPython 2.7, 3.5+MySQL 5.5 or higherInstallationInstall cython (optional)# pip install cythonInstall cymysql# pip install cymysqlMySQL 8.0 and insecure connectionIf you use caching_sha2_password authentication plugin (MySQL 8.0 default)
and connect with ‘not ssl and not unix_socket’ you shoud install pycryptodome# pip install pycryptodomeExamplePython Database API Specification v2.0https://peps.python.org/pep-0249/import cymysql
conn = cymysql.connect(host='127.0.0.1', user='root', passwd='', db='database_name')
cur = conn.cursor()
cur.execute('select foo, bar from baz')
for r in cur.fetchall():
   print(r[0], r[1])asyncioIn Python3, you can use asyncio to write the following.This API is experimental.
If there are any mistakes, please correct them in the pull request and send.Use connectimport asyncio
import cymysql

async def conn_example():
    conn = await cymysql.aio.connect(
        host="127.0.0.1",
        user="root",
        passwd="",
        db="database_name",
    )
    cur = conn.cursor()
    await cur.execute("SELECT 42")
    print(await cur.fetchall())
asyncio.run(conn_example())Use poolimport asyncio
import cymysql

async def pool_example(loop):
    pool = await cymysql.aio.create_pool(
        host="127.0.0.1",
        user="root",
        passwd="",
        db="database_name",
        loop=loop,
    )
    async with pool.acquire() as conn:
        async with conn.cursor() as cur:
            await cur.execute("SELECT 42")
            print(await cur.fetchall())
    pool.close()
    await pool.wait_closed()

loop = asyncio.get_event_loop()
loop.run_until_complete(pool_example(loop))
loop.close()
Package: cyndilib
A Python wrapper forNewtek NDI®written inCythonDescriptionNDI® allows video and audio to be reliably sent and received over IP with
minimal latency and very high quality. For more information seehttps://ndi.tv/.This project aims to wrap most functionality of theNDI® SDKfor use in
Python. Due to the real-time nature of audio and video, nearly all of this
library is written inCythonfor performance purposes. By design, “cyndilib”
may be used within other Cython code.LinksProject Homehttps://github.com/nocarryr/cyndilibDocumentationhttps://cyndilib.readthedocs.ioPyPIhttps://pypi.org/project/cyndilibInstallationInstallation viapipis supported using pre-built platform wheels:pip install cyndilibAll of the necessary headers and Cython files are included in the distribution.
This will allow for development of applications directly usingcimportdirectives.BuildingFor Windows, theNDI® SDKwill need to be downloaded and installed before
building. MacOS and most Linux shouldn’t require this.Clone or download the repository:git clone https://github.com/nocarryr/cyndilib.git
cd cyndilibIfpipenvis installed on your system,
the provided Pipfile may be used:pipenv install --devIf encountering errors, try compiling the extensions manually using:python setup.py build_ext --inplaceThis should display more useful error messages.UsageDocumentation can be found athttps://cyndilib.readthedocs.io.
Since this project is still in its early stages of development however,
a look at the example code and tests in the repository might be more useful.Licensecyndilib is licensed under the MIT license. See includedLICENSEfile.NDI® is a registered trademark of NewTek, Inc. Its associated license
information can be found inlibndi_licenses.rst.⚠ Distribution Considerations ⚠Before distributing or including this in your own projects it isimportantthat you have read and understand the “Licensing” section included in theNDI® SDKDocumentation.There are specific requirements listed for branding, trademark use and URLs to
be displayed, etc. To the best of my knowledge this project is following the
guidelines and corrections will be made if discovered otherwise.Liability for derivative works, etc falls under the responsibility of their authors.
Package: cynergy
IOCynergyPython module for IOC container using dependency injection (uses python 3+ type hints, supported until Python3.7)Easy way to initialize your servicesfromcynergyimportcontainerclassTestClass:passclassParentClass:def__init__(self,test_class:TestClass):self.test_class=test_classinstance=container.get(ParentClass)# Returns TestClass initialized as singletonprint(type(instance))# ParentClassprint(type(instance.test_class))# TestClassAccess to your configuration from any servicefromcynergyimportcontainerfromcynergy.configimportConfig,MemoryConfigfromcynergy.attributesimportarguments@arguments(db=Config('db_name'),host=Config('hostname'))classDbConnector:def__init__(self,db:str,host:str):self.db=dbself.host=hostcontainer.initialize(MemoryConfig({"db_name":"LocalDbName","hostname":"localhost"}))instance=container.get(DbConnector)print(instance.db)# LocalDbNameprint(instance.host)# localhost** You can implement your own configuration provider (for exmaple you can create DbConfigProvider which provides your settings from the db)Manually register special typesfromcynergyimportcontainerclassOriginal:passclassOther:passcontainer.register_class(Original,Other)instance=container.get(Original)print(type(instance))# OtherRegister collection of servicesfromtypingimportListfromcynergyimportcontainerclassHandlerBase:passclassSomeHandler1(HandlerBase):passclassSomeHandler2(HandlerBase):passclassSomeService:def__init__(self,handlers:List[HandlerBase]):self.handlers=handlerscontainer.register_many(HandlerBase,[SomeHandler1,SomeHandler2])instance=container.get(SomeService)print(type(instance.handlers))# listprint(type(instance.handlers[0]))# SomeHandler1print(type(instance.handlers[1]))# SomeHandler2
Package: cynet
Info:See <https://arxiv.org/abs/1406.6651> for theoretical backgroundAuthor:ZeD@UChicago<zed.uchicago.edu>Description:Implementation of the Deep Granger net inference algorithm, described inhttps://arxiv.org/abs/1406.6651, for learning spatio-temporal stochastic processes (point processes).cynetlearns a network of generative local models, without assuming any specific model structure.NoteIf issues arise with dependencies in python3, be sure thattkinteris installedsudo apt-get install python3-tkUsage:from cynet import cynet
from cynet.cynet import uNetworkModels as models
from viscynet import viscynet as vcncynet module includes:cynetviscynetcynet library classes:spatioTemporaluNetworkModelssimulateModelsxgModelsExamples of Pipeline:You may find two examples of this pipeline in your enviroment’s bin folder
after installing the cynet package. There will also be a pdf walking through
another extremely detailed example.Produces detailed timeseries predictions using Deep Granger Nets.Description of Pipeline:You may find two examples of this pipeline in your enviroment’s bin folder
after installing the cynet package.Step 1:Use the spatioTemporal class and its utility functions to fit and
manipulate your data into a timeseries grid. The end outputs will be triplets:
files that contain the rows (coordinates), the columns (dates), and the timeseries.
The splitTS function will help generate rows of the timeseries. Generally, we
use this to create timeseries beyond the length of the data in the triplets.
We use the triplets to generate predictive models and then split, which have
the longer timeseries to evaluate those models.Step 2:Run xGenESeSS on the triplets to generate predictive models. The
xgModels class can be used to assist in this step. If running on a cluster,
set run local to false and calling xgModels.run() will generate the shell
commands to run xGenESeSS in a text file. Otherwise, xgModels will run
locally using the binary installed with the package. The end result are predictive
models. Note that example 1 starts at this point. Thus there are sample models
provided.Step 3:To evaluate the models afterwards, use the run_pipeline utility function.
This calls uNetworkModels and simulateModels in parallel to evaluate each model.
simulateModels calls the cynet and flexroc binaries. Outputs will be auc, tpr,
and fpr statistics.See example 2 for an example of the entire pipeline.
Package: cynq
cynq is a core framework to aide in syncing of remote data stores.You are able to sync 1 or many remote sources of data with a local source.
It takes care of bidirectional syncing for you so you don’t have to worry
about it.still more work to be done to make this completely client friendly, but it
is viable as it exists todaystill lots more docs to addTODO: add docs so someone else can grok (or I can grok after a couple months off)
Package: cynthia-language
Cynthia script languageCynthia is a small interpreted script language for basic mathematical expressions written in python.The language currently supports:the four fundamental operations of arithmetic (addition,subtraction,multiplication,division)parentheseswhich can modify the order of operations.variablesandvariable assignmentsa number ofbuilt-infunctionsBuilt-in functions:min(*args) -> numberReturns the minimum value of the arguments.max(*args) -> numberReturns the maximum value of the arguments.print(*args)Prints the arguments to the standard output.Installationpip install cynthia-languageUsageshell enviromentCynthia language can be run in ashell enviromentwhere each expression
will be evaluated and printed out to the standard output.$: python -m cynthia
cynthia> 3 * (5 + 2) / 4
5.25
cynthia> x = 3 * 3
cynthia> 4 * x - 5
31executing.cynthiafilesCynthia language code can be written in.cynthiafiles:# example.cynthia file

# you can write comments
a = 1
b = 2
c = a + b * 3

result = min(a, b, c)

print(result)Which can be executed with the interpreter:python -m cynthia example.cynthiaCFG for the syntaxprogram
    : statement_list EOF
    ;

statement_list
    : statement
    | statement EOL statement_list
    ;

statement
    : assignment_statement
    | expr
    | EMPTY
    ;

assignment_statement
    : VARIABLE ASSIGN expr
    ;

expr
    : term
    | term PLUS expr
    | term MINUS expr
    :

term
    : factor
    | factor MUL term
    | factor DIV term
    ;

factor
    : NUMBER
    | VARIABLE
    | L_PAREN expr R_PAREN
    | PLUS expr
    | MINUS expr
    | function_call
    ;

function_call
    : ID L_PAREN args R_PAREN
    ;

args
    : expr
    | expr COMMA args
    ;Use the language tools directlyLanguage tools can be used directly.from cynthia.tools import Interpreter

interpreter = Interpreter()
interpreter.interpret('x=1+2')

interpreter['x']
# 3
Package: cypari2
A Python interface to the number theory libraryPARI/GP.InstallationFrom a distribution package (GNU/Linux, conda-forge)A package might be available in your package manager, seehttps://repology.org/project/python:cypari2/versionsFrom source with pipRequirements:PARI/GP >= 2.9.4 (header files and library); seehttps://doc.sagemath.org/html/en/reference/spkg/pari#spkg-parifor availability in distributions (GNU/Linux, conda-forge, Homebrew, FreeBSD),
or install from source.Python >= 3.6pipInstall cypari2 via the Python Package Index (PyPI) via$ pip install cypari2 [--user](the optional option–userallows to install cypari2 for a single user
and avoids using pip with administrator rights).pipbuilds the package using build isolation.  All Python build dependencies
of the package, declared in pyproject.toml, are automatically installed in
a temporary virtual environment.If you want to try the development version, use$ pip install git+https://github.com/sagemath/cypari2.git [--user]If you have an error saying libpari-gmp*.so* is missing and have all requirements
already installed, try to reinstall cysignals and cypari2$ pip install cysignals --upgrade [--user]
$ pip install cypari2 --upgrade [--user]UsageThe interface as been kept as close as possible from PARI/GP. The following
computation in GP? zeta(2)
%1 = 1.6449340668482264364724151666460251892

? p = x^3 + x^2 + x - 1;
? modulus = t^3 + t^2 + t - 1;
? fq = factorff(p, 3, modulus);
? centerlift(lift(fq))
%5 =
[            x - t 1]

[x + (t^2 + t - 1) 1]

[   x + (-t^2 - 1) 1]translates into>>> import cypari2
>>> pari = cypari2.Pari()

>>> pari(2).zeta()
1.64493406684823

>>> p = pari("x^3 + x^2 + x - 1")
>>> modulus = pari("t^3 + t^2 + t - 1")
>>> fq = p.factorff(3, modulus)
>>> fq.lift().centerlift()
[x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]The objectpariabove is the object for the interface and acts as a
constructor. It can be called with basic Python objects like integer
or floating point. When called with a string as in the last example
the corresponding string is interpreted as if it was executed in a GP shell.Beyond the interface objectpariof typePari, any object you get a
handle on is of typeGen(that is a wrapper around theGENtype from
libpari). All PARI/GP functions are then available in their original names asmethodslikezeta,factorff,liftorcenterliftabove.Alternatively, the pari functions are accessible as methods ofpari. The
same computations be done via>>> import cypari2
>>> pari = cypari2.Pari()

>>> pari.zeta(2)
1.64493406684823

>>> p = pari("x^3 + x^2 + x - 1")
>>> modulus = pari("t^3 + t^2 + t - 1")
>>> fq = pari.factorff(p, 3, modulus)
>>> pari.centerlift(pari.lift(fq))
[x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]The complete documentation of cypari2 is available athttp://cypari2.readthedocs.ioand
the PARI/GP documentation athttp://pari.math.u-bordeaux.fr/doc.htmlContributingSubmit pull request or get in touch with the SageMath developers.
Package: cypcap
This package is a Cython based binding for modern libpcap versions, for Python 3.6+, attempting to
be more complete than existing and poorly maintained packages.DocumentationInstallation$ pip install cypcapPython 3.6+ and libpcap 1.8+ is required (Older libpcap versions can be supported if needed).Build From SourceOn Windows, download and extract theNpcap SDKand set the enviromnet variableNPCAP_SDKto
its location (You will also need to install Npcap, Wireshark installs it as part of its
installation).On Linux, install the libpcap development package from your package manager. e.g. For Ubuntu:$ sudo apt update && sudo apt install libpcap-devQuickstartimportcypcapdev=cypcap.findalldevs()[0]# You should filter the list or let the user choose a devicewithcypcap.create(dev)aspcap:pcap.set_snaplen(65536)pcap.set_promisc(True)pcap.set_timeout(1000)pcap.activate()forpkthdr,datainpcap:ifpkthdrisNone:continueprint(pkthdr,data)License3-Clause BSD license (The same kind of license that libpcap uses).