Saravanan666/pypi-org huggingface dataset:
Package: km3astro
AboutKM3Astro is a collection astronomy utils, like coordinate transformations.InstallThis is developed on python >=3.5. Lower versions (especially py2)
might or might not work. Usepipto install the latest
version:pip install km3astroInstall the latest development versionTo get the latest and greatest stable development version, usepipand the URL to the repository:pip install git+http://git.km3net.de/km3py/km3astro.gitor just clone the git repository and install viapip install .
Package: km3compass
Light weight package to read and exploit km3net compass dataSetupCurrently, only solution is to install the repository from source.
After cloning the repository, you can install it with pip (preferably inside a virtual env).
From inside the repository:pipinstall./And you are done !Command line interfaceThis package provides some command line tool that can be used to interact with compass data.AcknowledgementsThanks especially to the gracious help of all contributors:Valentin Pestel, Adrian Saina, Tamas Gal, Cristiano Bozza, Bryan Darquea, Jhilik Majumdar
Package: km3flux
The km3flux Python packageAboutKM3Flux is a collection of neutrino flux models + assorted utilities for
computing event weights.InstallThis is developed on python 3.6. Lower versions (especially py2)
might or might not work.Install the dependenciesnumpypandash5pypytablesIn your python env, do:pip install km3fluxor just clone the git repository and install viapip install .
Package: km3irf
KM3NeT instrument response functionsThis project provides a versatile tool that can be used to quickly analyze the sensitivity of theKM3NeTdetector for various source models.
Currently it considers only point-like sources. The main feature of the tool is deep targeting togammapysoftware.
At same time it is independent from installation ofgammapysoftware.
For further analysis ingammapy,km3irfprovides next modules:Instrument response function (IRF)Effective area (Aeff)Energy dispertion (Edisp)Point spread function (PSF)Data set (in progress)Event list (in progress)InstallationIt is recommended to create an isolated virtualenvironment to not interfere
with other Python projects, preferably inside the project’s folder. First clone
the repository with:git clone git@git.km3net.de:km3py/km3irf.gitor:git clone https://git.km3net.de/km3py/km3irf.gitCreate and acitvate a virtual environment:cd km3irf
python3 -m venv venv
. venv/bin/activateInstall the package with:make installYou can also install the package directly fromPypiviapippackage manager (no cloning needed).
It can easily be done into any Python environment with next command:pip install km3irfTo install all the development dependencies, in case you want to contribute or
run the test suite:make install-dev
make test—Created with ``cookiecutter https://git.km3net.de/templates/python-project``
Package: km3net-testdata
A hybrid Python/Julia package to get access to KM3NeT sample files for testing and development
purposes.Installation and usagePythonpip install km3net-testdataThe file paths can be access in Python scripts using thedata_path()function:fromkm3net_testdataimportdata_pathfilename=data_path("offline/km3net_offline.root")Notice the underscore in the Python package name (PyPI forces-but Python
package names are not allowed to use-).JuliaMake sure the “KM3NeT Julia Registry” is added to your local Julia registries,
seehttps://git.km3net.de/common/julia-registryfor more information.
The Julia package is calledKM3NeTTestDataand can be installed the usual way:julia>importPkg;Pkg.add("KM3NeTTestData")The package exports thedatapath()function which can be used similar to the Python implementation:julia>usingKM3NeTTestDatajulia>filename=datapath("offline","km3net_offline.root")"/Users/tamasgal/.julia/packages/KM3NeTTestData/zb9oT/src/../km3net_testdata/data/offline/km3net_offline.root"ShellTo use the Python module in e.g. shell scripts, it can be called directly to
print the filepath:$python-mkm3net_testdataoffline/km3net_offline.root/full/path/to/offline/km3net_offline.rootIt can be combined with other shell tools, as usual:$head-n5$(python-mkm3net_testdatadetx/detx_v3.detx)# a comment line
# another comment line starting with '#'23v31500000000.19999999999.0UTMWGS8432N256500.04743000.0-2425.0AcknowledgementsThe project idea and implementation were inspired by the Scikit-HEP Projecthttps://github.com/scikit-hep/scikit-hep-testdata
Package: km3pipe
KM3Pipe is a framework for KM3NeT related stuff including MC, data files, live
access to detectors and databases, parsers for different file formats and an
easy to use framework for batch processing.The main Git repository, where issues and merge requests are managed can be
found athttps://git.km3net.de/km3py/km3pipe.gitThe framework tries to standardise the way the data is processed by providing
a Pipeline-class, which can be used to put together different built-in or user
made Pumps, Sinks and Modules. Pumps act as data readers/parsers (from files,
memory or even socket connections), Sinks are responsible for writing data to
disk and Modules take care of data processing, output and user interaction.
Such a Pipeline setup can then be used to iteratively process data in a file or
from a stream. In our case for example, we store several thousands of neutrino
interaction events in a bunch of files and KM3Pipe is used to stitch together
an analysis chain which processes each event one-by-one by passing them through
a pipeline of modules.Although it is mainly designed for the KM3NeT neutrino detectors, it can easily
be extended to support any kind of data formats. The core functionality is
written in a general way and is applicable to all kinds of data processing
workflows.To start off, run:pip install km3pipeIf you have Docker (https://www.docker.com) installed, you can start using
KM3Pipe immediately by typing:docker run -it docker.km3net.de/km3pipeFeel free to get in touch if you’re looking for a small, versatile framework
which provides a quite straightforward module system to make code exchange
between your project members as easily as possible. KM3Pipe already comes with
several types of Pumps, so it should be easy to find an example to implement
your owns. As of version 8.0.0 you find Pumps and Sinks based on popular
formats like HDF5 (https://www.hdfgroup.org), ROOT (https://root.cern.ch) but
also some very specialised project internal binary data formats, which on the
other hand can act as templates for your own ones. Just have a look at the io
subpackage and of course the documentation if you’re interested!Read the latest docs athttps://km3py.pages.km3net.de/km3pipe.KM3NeT public project homepagehttp://www.km3net.orgAcknowledgementsThanks especially to the gracious help of all contributors:Tamas Gal, Moritz Lotze, Johannes Schumann, Piotr Kalaczynski, Jonas Reubelt, Michael Moser, Thomas Heid, Alba Domi, Agustin Sanchez Losa, Zineb Aly, Jordan Seneca, Nicole Geisselbrecht, Javier Barrios, Valentin Pestel, Jannik Hofestaedt, Matthias Bissinger, Vladimir Kulikovskiy, Lukas Hennig
Package: km3services
This Python package provides access to KM3NeT microservices. It’s in an early development
stage and the API will likely change any until v1.0.0 is released.InstallationAs usual, install withpip:pip install km3servicesAvailable MicroservicesOscProbThekm3services.oscprobmodule wraps theOscProbpackage to calculate neutrino
oscillation probabilities. Here is an example how to calculate the transition
probabilities from muon to electron neutrino (the API will be polished soon):fromkm3services.oscprobimportOscProbimportnumpyasnposcprob=OscProb()# here you can pass a different server/portn=1000energies=np.random.randint(1,50,n)# generate `n` energies between 1-50 GeVcos_zeniths=-np.random.rand(n)/2# Use PDG particle encoding!flav_in=12# electron neutrinoflav_out=14# muon neutrinoprobabilities=oscprob.oscillationprobabilities(flav_in,flav_out,energies,cos_zeniths)print(probabilities)The returnedprobabilitiesis a numpy array:[4.20254330e-03 7.46278836e-05 6.18139696e-04 4.03814960e-03
3.38002558e-03 3.33962606e-04 4.53159234e-02 5.03111960e-02
...
2.23391190e-03 2.07540790e-03 6.71385177e-03 3.03348121e-02
1.86633322e-02 4.81416626e-03 4.55362912e-05 3.59935810e-03]
Package: kma
# KMAKorea weather information library for kma.go.kr under python3### DependenciesThis library uses below libraries. Please refer requirements.txt for the details.1. urllib32. certifi3. pytz### How to use this library#### 1. Request to issue a service keyPlease visit below url.You should understand Korean language, I think.https://www.data.go.kr/dataset/15000099/openapi.do#### 2. Install```pythonpip install kma```#### 3. Sample code```pythonfrom kma import Weatherw = Weather('YOUR_SERVICE_KEY')curr = w.get_current()forecast = w.get_forecast()print('Current temperature: {}'.format(curr.temperature))```#### Deprecated features##### 1. Sky statusNo longer supported by Korea Meteorological Administration.
Package: kmailbox
kmailboxis a python email library, support for sending and receiving emails via SMTP and IMAP protocol。send plain text email:fromkmailboximportMessage,MailBoxmsg=Message()msg.sender="Tester<test@google.com>"msg.recipient="hello@google.com"msg.subject="kmailbox test"msg.content="This is test"mailbox=MailBox(smtp_host="smtp.gmail.com",use_tls=True)mailbox.username="username"mailbox.password="password"mailbox.send(msg)send html email:msg=Message()msg.sender="Tester<test@google.com>"msg.recipient="hello@google.com"msg.subject="kmailbox test send html and add attachments"msg.is_html=Truemsg.content="""\<body>
<p><img src="cid:0"></p>

<p>Hello! I am <em>Huoty</em>.</p>

<p>How are you?</p>

<p>Give you a picture:</p>
<p><img src="cid:1"></p>
</body>
"""msg.attachments=["cid0:imgs/mailbox-icon.png","cid1:imgs/20171005170550.jpg","kmailbox.py","README.md"]mailbox=MailBox(smtp_host="smtp.gmail.com",use_ssl=True,username="username"password="password")mailbox.send(msg)receive mails:mailbox=MailBox(imap_host="imap.gmail.com",use_ssl=True)mailbox.username="username"mailbox.password="password"mailbox.select()formailmailbox.all(mark_seen=False,gen=True)pprint({"uid":mail.uid,"sender":mail.sender,"to_addrs":mail.to_addrs,"subject":mail.subject,"date":str(mail.date),"flags":mail.flags,"attachments":[att.filenameforattinmail.attachments],})mailbox.logout()
Package: kmaintainer
KmaintainerFjmaro Photography and Media date maintainer.Purpose of the programThe purpose of this program is to maintain the original date of the photos, videos, files, and other media files (without EXIF data to have it stored) after unwanted modifications by third-party software. It also includes the functionality of renaming 'proprietary' files to KDIN convention.This program uses the file-naming described inKjmaroconvention to identify the file-date by its name.
Package: kmapper
KeplerMapperNature uses as little as possible of anything. - Johannes KeplerThis is a Python implementation of the TDA Mapper algorithm  for visualization of high-dimensional data. For complete documentation, seehttps://kepler-mapper.scikit-tda.org.KeplerMapper employs approaches based on the Mapper algorithm (Singh et al.) as first described in the paper "Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition".KeplerMapper can make use of Scikit-Learn API compatible cluster and scaling algorithms.InstallDependenciesKeplerMapper requires:Python (>= 3.6)NumPyScikit-learnUsing the plotly visualizations requires a few extra libraries:Python-IgraphPlotlyIpywidgetsAdditionally, running some of the examples requires:matplotlibumap-learnInstallationInstall KeplerMapper with pip:pip install kmapperTo install from source:git clone https://github.com/MLWave/kepler-mapper
cd kepler-mapper
pip install -e .UsageKeplerMapper adopts the scikit-learn API as much as possible, so it should feel very familiar to anyone who has used these libraries.Python code# Import the classimportkmapperaskm# Some sample datafromsklearnimportdatasetsdata,labels=datasets.make_circles(n_samples=5000,noise=0.03,factor=0.3)# Initializemapper=km.KeplerMapper(verbose=1)# Fit to and transform the dataprojected_data=mapper.fit_transform(data,projection=[0,1])# X-Y axis# Create dictionary called 'graph' with nodes, edges and meta-informationgraph=mapper.map(projected_data,data,cover=km.Cover(n_cubes=10))# Visualize itmapper.visualize(graph,path_html="make_circles_keplermapper_output.html",title="make_circles(n_samples=5000, noise=0.03, factor=0.3)")DisclaimerStandard MIT disclaimer applies, seeDISCLAIMER.mdfor full text. Development status is Alpha.How to citeTo credit KeplerMapper in your work:https://kepler-mapper.scikit-tda.org/en/latest/#citations
Package: kmars
IntroductionThis is an implementation of K-means/medians/medoids with various distance metrics (Euclidean, Manhattan, Cosine...) built over Numpy.I created this library for my own use, because the KMeans class of the Scikit-learn library lacks options for customising the variant of the K-algorithm and options for using distance metrics besides Euclidean distance.This library was developed with the intention to replicate the functionality and parameter convention used in Scikit-learn as close as possible so that end users, such as myself, will have little difficulty writing code for K-algorithm clustering machine learning tasks with KMars. The additional distance metrics not present in sklearn's clustering module such as manhattan, minikowski, and cosine enable better results when working with high dimensional data.Jupyter notebook comparison with sklearn:https://github.com/jerrold110/Library-Kmars/blob/main/notebooks/Comparison%20of%20Sklearn%20and%20Kmars.ipynbExample:pip install kmarshttps://pypi.org/project/kmars/importnumpyasnpfromkmarsimportKMeans,KMedians,KMedoidsX=np.array([[1,2],[1,4],[1,0],[10,2],[10,4],[10,0]])km=KMeans(4,dist='euclidean',init='kmeans++')KMeans.fit(X)labels=km.labels_cetroids=km.cluster_centers_print(help(KMeans))Features:Algorithms: KMeans, KMedians, KMedoidsDistance metrics: 'euclidean','manhattan','minikowski','cosine','hamming'K-means++ centroid initialisation with seed search in selected distance metricFrobenius (L2) norm convergence, and tolerance parameterGetter methods for many metrics after fitting for initial and final centroidsSelection of Sum-Square-Error or Sum-Error metric for KMedoids cluster centroid update and overall fit scoreData type changes to float64 during distance calculation to avoid numerical overflowDistance metricsThe distance metric selected at initialisation is the same metric used for:Centroid initialisation with kmeans++Sum squares error metrics in distance metric at initialisationKmedoids centroid selection and all-cluster-centroid-update-approvalManhattan distance (L1 norm) SSE residuals as a common metric to compare different distance metrics of the same modelAvailable metrics after fitting model to datainit_cluster_centers_: position of initial centroidsinit_labels_: closest initial centroid of each data pointinit_sse_: sum of squared errors of initial clusters in the chosen distance metriccluster_centers_: positions of final centroidslabels_: closest final centroid of each data pointsse_: sum of squared errors of final clusters in the chosen distance metricssr_: sum of squared errors of final clusters in Manhattan distance (L1 norm)n_iter_converge_: number of iterations for convergencex_samples_: number of samples of data during fitx_features_: number of features in each datum during fitFuture featuresData validation to take in pandas dataframesMore algorithms, algorithm upgrades (FastPAM for Kmedoids instead of Naive)More distance metrics (eg: improved sqrt cosine)Heuristic centroid initialisation: picks the n_clusters points with the smallest sum distance to every other pointIssuesCurrently only accepts 2 dimensional numpy arrays as input
Package: kmaxtools
The Kmax Tool SuiteGetting StartedUpgradingkmaxtoolsAdditional DocumentationThe Kmax Tool SuiteGetting StartedInstallpip3, Linux's build dependencies, andkmaxtools:sudo apt install -y python3-pip flex bison bc libssl-dev
sudo pip3 install kmaxtoolsDownload the Linux source:wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.tar.xz
tar -xvf linux-5.4.tar.xzRunklocalizercd linux-5.4/
klocalizer drivers/usb/storage/alauda.oBuild the.configfile made byklocalizer:make ARCH=x86_64 olddefconfig
make ARCH=x86_64 clean drivers/usb/storage/alauda.oCross-CompilingGetmake.cross:sudo apt install -y xz-utils lftp
wget https://raw.githubusercontent.com/fengguang/lkp-tests/master/sbin/make.crossRunklocalizerwith a different architecture:klocalizer -a powerpc drivers/block/ps3disk.o
bash make.cross ARCH=powerpc olddefconfig; bash make.cross ARCH=powerpc clean drivers/block/ps3disk.oAdditional DocumentationOverviewAdvanced UsageBugs Found bykmaxtools
Package: kmdouglass.udesigner
Micro-DesignerDesign tools for microscopesGetting StartedInstallationpip install kmdouglass-udesignerUsageRun the following commands tofirst generate a JSON template for the microscope design parameters, and thencreate a HTML design document for a diffraction phase microscope.#Createaninputstemplatethatyoucaneditudesign -t dpm inputs -o inputs.json#CreateanHTMLdesigndocumentforthemicroscopeudesign -t dpm doc -i inputs.json -o output.htmlSupported Types of MicroscopesDiffraction PhaseMultifocal Koehler IntegratorTo see the names of the corresponding types, run the following command:udesign -h
Package: kmdvalg
What is kmdvalg?It is a wrapper aroundBeautifulSoupto extract data from www.kmdvalg.dk.Bokeh map patches are created withpyshpfrom shapefiles.The shapefile dataset is: ‘Digdag (Kommunal)’ and ‘DAGI 1:2 mio’ downloaded 2017/12/03 fromhttps://download.kortforsyningen.dk.The voting information is combined with map information before plotting.Important linksSource code:https://github.com/tlinnet/kmdvalgPyPI package:https://pypi.python.org/pypi/kmdvalgSee examplesUsenbviewer.jupyter.orgto:See Notebook to list Danske kommuner:get_kommune.ipynbSee Notebook to make bokeh map of Kommunevalg 2017:get_kommune_map.ipynbLaunch interactive Jupyter Notebookmybinder.orgto try examples:How to install?If using conda, these steps will install an environment# With pip from https://pypi.python.org/pypi/kmdvalgpipinstallkmdvalgDeveloper install for local conda environment:# Create environmentcondaenvcreate-fenvironment.yml# Activate environmentcondaenvlistsourceactivatekmdvalg# Enable ipywidgetsjupyternbextensionlistjupyternbextensionenable--pywidgetsnbextension--sys-prefix# Start jupyterjupyternotebookOr manual install in root environment:# Manually install packagepythonsetup.pyinstall--force#  Manually uninstallpythonsetup.pyinstall--recordfiles.txtPACK=`dirname$(head-n1files.txt)`rm-rf$PACK#cat files.txt | xargs rm -rfDeveloperGuide for upload:http://peterdowns.com/posts/first-time-with-pypi.htmlUpdated info:https://packaging.python.org/guides/migrating-to-pypi-org/#uploadingPyPI test account:http://testpypi.python.org/pypi?%3Aaction=register_formPyPI Live account:http://pypi.python.org/pypi?%3Aaction=register_form# Modify version in: kmdvalg/__init__.py# Create tagVERS=`python-c"from kmdvalg import __version__; print(__version__)"`# Adds a tag so that we can put this on PyPIgittag$VERS-m""gitpush--tagsoriginmaster# Upload your package to PyPI Testpythonsetup.pysdistupload-rpypitestopenhttps://testpypi.python.org/pypi/kmdvalg# Upload to PyPI Live
# Once you've successfully uploaded to PyPI Test, perform the same steps but point to the live PyPI server instead.pythonsetup.pysdistupload-rpypiopenhttps://pypi.python.org/pypi/kmdvalg
Package: kme
kmeA Python library that enables building simple Kafka consumer/producer micro/nano servicesThis is a library that wraps thekafka-pythonlibrary with some message routing helpers.With this library, you can create micro/nano services (think like a Function, FaaS) that listens to one or more Kafka topics
and processes the message, then based on configuration can send a new message.I developed this with the intent to create a distributed workflow for various automation activities in my Kubernetes cluster
and outside as well.The workflow that I initially designed this for was:On a schedule, submit a message to the "wakup-computer" topic.  This message contains details on which computer to
wake up and how we determine when the computer is ready for work, and "completion topic", where we send a message
when the computer is alive!  In my case, I have an old server with a ton of hard drives, which I use for cold
backups.  I only need it on while backups are running.The completion topic, lets call it "run-backups" would accept the message and perform the backup processes.  Once it
has completed, it will send a new message to the "shutdown-computer" topic.The "shutdown-computer" topic has a consumer group for each computer which is included in this flow, and it receives
the message and sees that it needs to shut down and does so.I also invision using this workflow for my on-premise Kubernetes cluster so that I can "auto scale" nodes up/down when
needed, reusing the "wakup-computer" and "shutdown-computer" topics and nano-services.UsagefromkmeimportKMEMessage,KMEimportos# produce a message with a completion topicdefkme_producer():message=KMEMessage(topic=os.environ.get('KAFKA_TOPIC'))message.message={'foo':'bar','bar':'foo'}message.completion_topic='foobar'k_client=KME(bootstrap_servers=[os.environ.get('KAFKA_BOOSTRAP_SERVER')])k_client.send_message(message=message)# setup a consumerdefkme_consumer():k_client=KME(bootstrap_servers=[os.environ.get('KAFKA_BOOSTRAP_SERVER')])print(f"Subscribing to{os.environ.get('KAFKA_TOPIC')}",flush=True)# IMPORTANT - note the callback value!!k_client.subscribe(os.environ.get('KAFKA_TOPIC'),consumer_group='me',callback=process_message)# this is the method which is called for each message, so put your logic here!defprocess_message(message:KMEMessage):print(f"Processing message{message}",flush=True)print(f"Message:{message.message}",flush=True)print(f"Topic:{message.topic}",flush=True)print(f"Completion Topic:{message.completion_topic}",flush=True)# if you want to pass a "completion message" you populate it and return it# if you don't want to pass a "completion message" just return `KMEMessage(topic='')`return_message=KMEMessage(topic=message.completion_topic)return_message.message="foo the bar"returnreturn_messageif__name__=='__main__':print("Starting",flush=True)kme_producer()# produce a messagekme_consumer()# now consume said messageprint("Finished",flush=True)
Package: kmeans
kmeanspython wrapper for a basic c implementation of the k-means algorithm.Please review the limitations before using in any capacity where strict
accuracy is required.  There is no overflow detection, and negatives are not
supported.  tuple values cannot exceed 255.Installationpip install kmeansUsageimport kmeans
means = kmeans.kmeans(points, k)pointsshould be a list of tuples of the form(data, weight)wheredatais a list with length 3.For example, finding four mean colors for a group of pixels:pixels = [
    [(15, 20, 25), 1],  # [(r,g,b), count]
    [(17, 31, 92), 5],
    # ... Lots more ...
]

centers = kmeans.kmeans(pixels, 4)In this case, the weights passed in may be the frequency of the pixels occuring
in an image, or some preference to pull the means towards a color.LimitationsAll values must benon-negativeintegers, with the following
restrictions:r, g, b        [0, 255]        (uint8_t)
count          [0, 4294967295] (uint32_t)
maximum points 4294967296      (uint32_t)
maximum means  256             (uint8_t)
max iterations 65536           (uint16_t)
max tolerance  65536           (uint16_t)Inspirationhttp://charlesleifer.com/blog/using-python-to-generate-awesome-linux-desktop-themes/I wanted to apply the implementation there to images much larger than 200x200.
Running a 4k x 3k image was approaching 60 seconds on a nice computer, so I
decided to rewrite the kmeans implementation in c.Contributorschinatsu- 32bit compatibility