Saravanan666/pypi-org huggingface dataset:
Package: kepi
kepikepi is a Django-based microblogging system, implemented in Python.
It uses the ActivityPub protocol to communicate with other servers,
and the Mastodon protocol to communicate with clients.There is nothing particularly interesting atkepi.org.uk,
but there will be.LinksThe installation guide(may be out of date)A guide to the structureThe roadmapSource controlThe bug trackerkepi threads on the activitypub forumsTriviabowler-heavywas a historical course change that may still affect the state of the codebase.Why the name?Licencekepi is distributed under version 2 of the GNU General Public License.Some Mastodon-based tests are included in the source distribution. These are copyright (C) 2016-2019 Eugen Rochko & other Mastodon contributors. They are released under the GNU Affero General Public License, version 3.The base template is based on the Clean Blog template by Start Bootstrap. This is copyright (c) 2013-2020 Start Bootstrap LLC. It's distributed under the MIT license.
Package: kepler-apertures
Kepler AperturesTake me to thedocumentation.
Paper coming soon!Tools to create aperture mask for Kepler sources using PRF models build from Kepler's
Full Frame Images.PRF modelsFirst we create PRF models using Kepler's FFI which contains ~10k Gaia EDR3 sources per Kepler's channel.The following figure shows the PRF models in the focal plane. Channels at the border shows PRFs with very distorted shapes, while in the center these are round and smooth.Later this PRF models are used to compute apertures photometry.Kepler's EXBA masksThe EXBA masks are custom apertures observed by Kepler's first mission, they cover relatively dark regions of the Kepler field and were observed continuously between quarters 4 and 17. The scientific motivation to collect these data was to obtain an unbiased characterization of the eclipsing binary occurrence fraction in the Kepler field.Here an example of the full EXBA mask observed in quarter 5 with channel 48Dependenciesnumpyscipyastropymatplotlibphotutilspandastqdmpatsypyialightkurve
Package: kepler.py
Fast and stable solver for Kepler's equation extracted fromexoplanet.InstallationThe best way to install is using pip:python-mpipinstallkepler.pyUsageThis package exposes two functions:kepler: Solves Kepler's equation and returns the cosine and sine of the true anomaly:importkeplereccentric_anomaly,cos_true_anomaly,sin_true_anomaly=kepler.kepler(mean_anomaly,eccentricity)solve: A lower-level interface that is used bykeplerto actually do the solving (Note that this will return garbage for eccentricities out of the range zero to one):importkeplereccentric_anomaly=kepler.solve(mean_anomaly,eccentricity)
Package: keplertools
keplertoolsTwo-body orbital propagation toolsInstallationpip install keplertoolsTo also compile the Cython versions (compiler required, see here for details:https://cython.readthedocs.io/en/latest/src/quickstart/install.html):pip install --no-binary keplertools keplertools[C]If using a zsh shell (or depending on your specific shell setup), you may need to escape the square brackets (i.e., the last bit of the previous command would bekeplertools\[C\].Documentationhttps://keplertools.readthedocs.io/
Package: keppy
===A Python parser of Kepware projects.# OverviewKEP.py parses the .json files exportable from the KEPServerEXConfiguration client.To use, read the contents of the .json file into a dictionary. Then,create aProjectobject and pass it the dictionary.From that project object, you can now get all of the channels of theproject and so on. The full list of the hierarchy you can reach is asfollows:Channel└─Device├─Register (See simulator device)└─Tag Group(s)├─tag1├─tag2…# UsageInstall with pippip install keppyor clone and runpython setup.py installTo see an extensive usage of this library, look at[kep-simgen](https://github.com/jmbeach/kep-simgen).Keywords: kepware parser
Platform: UNKNOWN
Description-Content-Type: text/markdown
Package: keptcha
Keptcha pykeptchais an API wrapper (python) forcaptcha-api. Provides both Synchronous and Asynchronous interfaces to interact with the API.InstallationpipinstallkeptchaOR using gitpipinstallgit+https://github.com/captcha-api/keptcha-pyUsagekeptchasupports both Sync and Async usage.SyncfromkeptchaimportCaptchamy_captcha=Captcha.new()my_captcha.decode()ifmy_captcha.verify("1337H4kOr"):print("You are not a bot!")AsyncfromkeptchaimportAsyncCaptchamy_captcha=awaitAsyncCaptcha.new()awaitmy_captcha.decode()if(awaitmy_captcha.verify("1337H4kOr")):print("You are not a bot!")ConfigurationYou can pass some keyword arguments to personalize your captcha.my_captcha=Captcha.new(height=100,width=250,circles=100,length=5)How to handle bad input?You can do exception handling.fromkeptcha.errorsimportIncorrectCaptchatry:my_captcha.verify("bad input")exceptIncorrectCaptcha:print("sir you suck")ContributingFeel free to submit a pull request. We very much appreciate it!LicenseLicenced underMIT.
Package: kepub-toolbox
Kepub Toolbox provides several utilities for conversion of ebook formatTypical usage for transforming an Open Office Document (.odt) into a DocBook
would look like this:#!/usr/bin/env python

    import sys
    from kepub.wpo.odt import Odt

    o = Odt(sys.argv[1])
    o.to_docbook()DownloadOverall project is published under Gnu Common License version 3 and can be
freely downloaded from PyPI or forked onBitBucket.
Package: keputils
keputils=====Basic module for interaction with KOI and *Kepler*-stellar tables.**Installation**::pip install keputilsInstalling will also install ``pandas``, ``plotutils``, and ``simpledist`` modules, if not already installed.The first time you import ``keputils.koiutils``, python will download the current cumulativeKOI table in .csv form from the `NASA Exoplanet Archive <http://exoplanetarchive.ipac.caltech.edu/>`_,and save it to ``~/.keputils/kois_cumulative.csv``.  Also, the first time importing, it will ingest the .csvdata and re-write it to an HDF5 file, from where it will read the data in the future (faster loading).Similarly, the first time you import ``keputils.kicutils``, python will download the *Kepler* stellar properties table,save it to the ``~/.keputils`` directory, and put it into the HDF5 file for future fast loading.
Package: keragan
keraganKeras implementation of GANsThis library provides some simple infrastructure to define and train Generative Adversarial Networks in Keras. It can also be used from the command line.InstallationThe simplest way to install is:pipinstallkeraganSome Images produced by keraganImages were trained onWikiArt.orgdataset taken fromhere.Minimalistic Landcape, 2020Spring Dawn, 2020Water Still 2, 2020---------Training GAN from the Command-LineTo start training, you can use the following command-line:python-mkeragan.trainerc:\dataset--size1024--model_path.\models--samples_path.\samples--latent_dim100--epochs1000You can find out more about other parameters by calling the program with--helpoption.Important things to note:--sizemust be power of 2, suitable values are 64, 128, 256, 512 and 1024. Higher resoltions are likely not to give good results.You can use--lrto set learning rate, default value is 0.001. Smaller learning rates yield better results, but may significantly increase training time.Generating ImagesOnce you have trained the model, you can use the generator model to produce new random images. To do that from a command line, you can use the following:python-mkeragan.generate--file./models/gen_1100.hdf5--out./samples--n100Use--helpoption to find out more about different options.ArchitectureThe library is structured around few core classes:GANis used to represent a GAN, withgeneratoranddiscriminatorfields that define corresponding networks.GANitself is abstract, and any subclass should definecreate_generator()andcreate_discriminator()functions. This class is also responsible for loading/saving networks to disk, and it can also generate sample images usingsample_imagesmethod.DCGANis currently the only subclass, implementing Deep Convolutional GAN.ImageDatasetis a class defining the process of loading initial dataset from disk, resizing it to specified size, filtering out bad images, etc.GANTraineris responsible to training a GAN, i.e. running epoch loop and periodically storing samples and network weights to disk.The actual training code looks like this:gan=keragan.DCGAN(args)imsrc=keragan.ImageDataset(args)imsrc.load()ifargs.sample_images:imsrc.sample_images()train=keragan.GANTrainer(image_dataset=imsrc,gan=gan,args=args)defcallbk(tr):ifargs.visual_inspection_intervalandtr.gan.epoch%args.visual_inspection_interval==0:res=tr.gan.sample_images(n=2)fig,ax=plt.subplots(1,len(res))fori,vinenumerate(res):ax[i].imshow(v[0])plt.show()train.train(callbk)
Package: keralagram
KeralaGramA python telegram asynchronous bot api made usingaiohttp.
This lib was earlier binded withhttpx. But after the initial release we found it much slower than aiohttp.
So we switched to aiohttpGetting started.Installation using pip:$ pip install keralagramWhile the API is production-ready, it is still under development, and it has regular updates, do not forget to update it regularly by callingpip install keralagram --upgradeWriting your first botPrerequisitesGet an API token via @BotFather. We will call this tokenTOKEN.
Furthermore, you have basic knowledge of the Python programming language and more importantlythe Telegram Bot API.A simple command botfromkeralagramimportKeralaGram,Dispatcherfromkeralagram.typesimportMessagebot=KeralaGram("TOKEN")dp=Dispatcher(bot)# you can use a list of prefixes or a single one# Also if the prefixes value is none defaults to "/"@dp.on_command("start",prefixes=["!","/"])asyncdefstart(c:KeralaGram,m:Message):awaitm.reply_text("hello")if__name__=='__main__':dp.run()The Telegram Chat GroupGet help. Discuss. Chat.Join theKerala Telegram Chat GroupWe now have a Telegram Channel as well! Keep yourself up to date with API changes, andjoin it.More examplesWILL BE SOON PUBLISHED
Package: keras-adabound
Keras AdaBoundAdaBoundoptimizer in Keras.Installpipinstallkeras-adaboundUsageUse the optimizerfromkeras_adaboundimportAdaBoundmodel.compile(optimizer=AdaBound(lr=1e-3,final_lr=0.1),loss=model_loss)Load with custom objectsfromkeras_adaboundimportAdaBoundmodel=keras.models.load_model(model_path,custom_objects={'AdaBound':AdaBound})About weight decayThe optimizer does not have an argument namedweight_decay(as in the official repo) since it can be done by adding L2 regularizers to weights:importkerasregularizer=keras.regularizers.l2(WEIGHT_DECAY/2)forlayerinmodel.layers:forattrin['kernel_regularizer','bias_regularizer']:ifhasattr(layer,attr)andlayer.trainable:setattr(layer,attr,regularizer)
Package: keras-adaptive-softmax
Keras Adaptive Softmax[中文|English]Installpipinstallkeras-adaptive-softmaxUsageGenerally,AdaptiveEmbeddingandAdaptiveSoftmaxshould be used together.AdaptiveEmbeddingprovides variable length embeddings, whileAdaptiveSoftmaxcalculates the similarities between the outputs and the generated embeddings.importkerasfromkeras_adaptive_softmaximportAdaptiveEmbedding,AdaptiveSoftmaxinput_layer=keras.layers.Input(shape=(None,))embed_layer=AdaptiveEmbedding(input_dim=30,output_dim=32,cutoffs=[5,15,25],div_val=2,return_embeddings=True,return_projections=True,mask_zero=True,)(input_layer)dense_layer=keras.layers.Dense(units=32,activation='tanh',)(embed_layer[0])softmax_layer=AdaptiveSoftmax(input_dim=32,output_dim=30,cutoffs=[5,15,25],div_val=2,bind_embeddings=True,bind_projections=True,)([dense_layer]+embed_layer[1:])model=keras.models.Model(inputs=input_layer,outputs=softmax_layer)model.compile('adam','sparse_categorical_crossentropy')model.summary()cutoffsanddiv_valcontrols the length of embeddings for each token. Suppose we have 30 distinct tokens, in the above example:The lengths of the embeddings of the first 5 tokens are 32The lengths of the embeddings of the next 10 tokens are 16The lengths of the embeddings of the next 10 tokens are 8The lengths of the embeddings of the last 5 tokens are 4
Package: keras-adf
keras-adfprovides implementations for probabilisticTensorflow/Kerasneural network layers,
which are based on assumed density filtering.
Assumed density filtering (ADF) is a general concept from Bayesian inference, but in the case of feed-forward neural networks that we consider here
it is a way to approximately propagate a random distribution through the neural network.The layers in this package have the same names and arguments as their corresponding
Keras version. We use Gaussian distributions for our ADF approximations, which are
described by their means and (co-)variances. So unlike the standard Keras layers,
eachkeras-adflayer takes two inputs and produces two outputs (one for the means
and one for the (co-)variances).keras-adflayers can be used exactly like the correspondingKeraslayers within a Keras model. However, as mentioned above, ADF layers take two inputs and produce two outputs
instead of one, so it is not possible to simply mix ADF and standard layers within the same model.fromtensorflow.kerasimportInput,Modelfromkerasadf.layersimportDensein_mean=Input((10,))in_var=Input((10,))out_mean,out_var=Dense(10,activation="relu")([in_mean,in_var])model=Model([in_mean,in_var],[out_mean,out_var])TheOverviewandExamplessections
of our documentation provide more realistic and complete examples.Project Informationkeras-adfis released under theMIT license,
its documentation lives atRead the Docs,
the code onGitHub,
and the latest release can be found onPyPI.
It’s tested on Python 2.7 and 3.4+.If you’d like to contribute tokeras-adfyou’re most welcome.
We have written ashort guideto help you get you started!Further ReadingAdditional information on the algorithmic aspects ofkeras-adfcan be found
in the following works:Jochen Gast, Stefan Roth,
“Lightweight Probabilistic Deep Networks”,
2018Jan Macdonald, Stephan Wäldchen, Sascha Hauch, Gitta Kutyniok,
“A Rate-Distortion Framework for Explaining Neural Network Decisions”,
2019AcknowledgmentsDuring the setup of this project we were heavily influenced and inspired by
the works ofHynek Schlawackand in particular hisattrspackage and blog posts ontesting and packainganddeploying to PyPI.
Thank you for sharing your experiences and insights.
Package: kerasAndMatplotlib
Keras is an open-source deep learning framework written in Python. It provides a high-level interface for building and training neural networks. Keras was developed with a focus on simplicity and ease of use, allowing researchers and developers to quickly prototype and build deep learning models.Keras is an open-source deep learning framework written in Python. It provides a high-level interface for building and training neural networks. Keras was developed with a focus on simplicity and ease of use, allowing researchers and developers to quickly prototype and build deep learning models.Keras is an open-source deep learning framework written in Python. It provides a high-level interface for building and training neural networks. Keras was developed with a focus on simplicity and ease of use, allowing researchers and developers to quickly prototype and build deep learning models.Keras is an open-source deep learning framework written in Python. It provides a high-level interface for building and training neural networks. Keras was developed with a focus on simplicity and ease of use, allowing researchers and developers to quickly prototype and build deep learning models.Keras is an open-source deep learning framework written in Python. It provides a high-level interface for building and training neural networks. Keras was developed with a focus on simplicity and ease of use, allowing researchers and developers to quickly prototype and build deep learning models.
Package: keras_attention_block
version: 0.0.2status: devauthor: hszemail:hsz1273327@gmail.comDesckeras-attention-block is an extension for keras to add attention. It was born from lack of existing function to add attention inside keras.
The module itself is pure Python with no dependencies on modules or packages outside the standard Python distribution and keras.keywords:keras,deeplearning,attentionFeaturesupport one dimensional attention, that is to take in inputs whose dimensions are batch_size * time_step * hidden_sizesupport two dimensional attention, that is to take in inputs of dimensions are batch_size * X * Y * hidden_sizesupport self-attention, that is to take in tensors. Four well defined calculations are included : additive, multiplicative, dot-product based and  as well as linear.support attention, that is to take in two tensors. Three well defined calculations are included : additive, multiplicative and dot product based.support attention. Three well defined calculations are included : additive, multiplicative and dot product based.support multihead attentionsupport customized calculations of similarity between Key and Querysupport customized calculations of ValueExamplefromkeras.layersimportmergefromkeras.layers.coreimport*fromkeras.layers.recurrentimportLSTMfromkeras.layersimportConvolution2Dfromkeras.modelsimport*fromkeras.layers.normalizationimportBatchNormalizationfromkeras_attention_blockimport*INPUT_DIM=32TIME_STEPS=20SINGLE_ATTENTION_VECTOR=FalseAPPLY_ATTENTION_BEFORE_LSTM=Falseinputs=Input(shape=(TIME_STEPS,INPUT_DIM))attention_mul=SelfAttention1DLayer(similarity="linear",dropout_rate=0.2)(inputs)#MyLayer((20,32))(inputs)#lstm_units=32#attention_mul = LSTM(lstm_units, return_sequences=False)(attention_mul)attention_mul=Flatten()(attention_mul)output=Dense(1,activation='sigmoid')(attention_mul)m=Model(inputs=[inputs],outputs=output)m.compile(optimizer='adam',loss='binary_crossentropy',metrics=['accuracy'])print(m.summary())train_data=np.random.random((1000,20,32))train_lab=np.random.randint(0,2,1000)m.fit(train_data,train_lab,epochs=1,batch_size=100)Installpython-mpip install keras_attention_blockDocumentationDocumentation on Readthedocs.TODO3D attention
Package: keras-balanced-batch-generator
keras-balanced-batch-generator: A Keras-compatible generator for creating balanced batchesInstallationpipinstallkeras-balanced-batch-generatorOverviewThis module implements an over-sampling algorithm to address the issue of class imbalance.
It generatesbalanced batches, i.e., batches in which the number of samples from each class is on average the same.
Generated batches are also shuffled.The generator can be easily used with Keras models'fitmethod.Currently, onlyNumPy arraysfor single-input, single-output models are supported.APImake_generator(x,y,batch_size,categorical=True,seed=None)x(numpy.ndarray)Input data. Must have the same length asy.y(numpy.ndarray)Target data. Must be a binary class matrix (i.e., shape(num_samples, num_classes)).
You can usetf.keras.utils.to_categoricalto convert a class vector to a binary class matrix.batch_size(int)Batch size.categorical(bool)If true, generates binary class matrices (i.e., shape(num_samples, num_classes)) for batch targets.
Otherwise, generates class vectors (i.e., shape(num_samples,)).seedRandom seed (see thedocs).Returns a Keras-compatible generator yielding batches as(x, y)tuples.Usageimporttensorflowastffromkeras_balanced_batch_generatorimportmake_generatorx=...y=...batch_size=...steps_per_epoch=...model=tf.keras.models.Sequential(...)generator=make_generator(x,y,batch_size)model.fit(generator,steps_per_epoch=steps_per_epoch)Example: Multiclass Classificationimportnumpyasnpimporttensorflowastffromkeras_balanced_batch_generatorimportmake_generatornum_samples=100num_classes=3input_shape=(2,)batch_size=16x=np.random.rand(num_samples,*input_shape)y=np.random.randint(low=0,high=num_classes,size=num_samples)y=tf.keras.utils.to_categorical(y)generator=make_generator(x,y,batch_size)model=tf.keras.models.Sequential()model.add(tf.keras.layers.Dense(32,input_shape=input_shape,activation='relu'))model.add(tf.keras.layers.Dense(num_classes,activation='softmax'))model.compile(optimizer='adam',loss='categorical_crossentropy',metrics=['accuracy'])model.fit(generator,steps_per_epoch=10,epochs=5)Example: Binary Classificationimportnumpyasnpimporttensorflowastffromkeras_balanced_batch_generatorimportmake_generatornum_samples=100num_classes=2input_shape=(2,)batch_size=16x=np.random.rand(num_samples,*input_shape)y=np.random.randint(low=0,high=num_classes,size=num_samples)y=tf.keras.utils.to_categorical(y)generator=make_generator(x,y,batch_size,categorical=False)model=tf.keras.models.Sequential()model.add(tf.keras.layers.Dense(32,input_shape=input_shape,activation='relu'))model.add(tf.keras.layers.Dense(1,activation='sigmoid'))model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['accuracy'])model.fit(generator,steps_per_epoch=10,epochs=5)
Package: keras-bcr
keras-bcr : Batch Correlation Regularizer for TF2/KerasThe batch correlation regularization (BCR) technique adds a penalty loss
if the inputs and outputs before the skip-connection of a specific feature element are correlated.
The correlation coefficients are computed for each feature element seperatly across the current batch.Usagefromkeras_bcrimportBatchCorrRegularizerimporttensorflowastf# The BCR layer is added before the addition of the skip-connectiondefbuild_resnet_block(inputs,units=64,activation="gelu",dropout=0.4,bcr_rate=0.1):h=tf.keras.layers.Dense(units=units)(inputs)h=h=tf.keras.layers.Activation(activation=activation)(h)h=tf.keras.layers.Dropout(rate=dropout)(h)h=BatchCorrRegularizer(bcr_rate=bcr_rate)([h,inputs])# << HEREoutputs=tf.keras.layers.Add()([h,inputs])returnoutputs# An model with 3 ResNet blocksdefbuild_model(input_dim):inputs=tf.keras.Input(shape=(input_dim,))h=build_resnet_block(inputs,units=input_dim)h=build_resnet_block(h,units=input_dim)outputs=build_resnet_block(h,units=input_dim)model=tf.keras.Model(inputs=inputs,outputs=outputs)returnmodelINPUT_DIM=64model=build_model(input_dim=INPUT_DIM)model.compile(optimizer=tf.keras.optimizers.Adam(),loss="mean_squared_error")BATCH_SZ=128X_train=tf.random.normal([BATCH_SZ,INPUT_DIM])y_train=tf.random.normal([BATCH_SZ])history=model.fit(X_train,y_train,verbose=1,epochs=2)AppendixInstallationThekeras-bcrgit repois available asPyPi packagepipinstallkeras-bcr
pipinstallgit+ssh://git@github.com/ulf1/keras-bcr.gitInstall a virtual environmentpython3-mvenv.venvsource.venv/bin/activate
pipinstall--upgradepip
pipinstall-rrequirements.txt--no-cache-dir
pipinstall-rrequirements-dev.txt--no-cache-dir
pipinstall-rrequirements-demo.txt--no-cache-dir(If your git repo is stored in a folder with whitespaces, then don't use the subfolder.venv. Use an absolute path without whitespaces.)Python commandsJupyter for the examples:jupyter labCheck syntax:flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')Run Unit Tests:PYTHONPATH=. pytestPublishpythonsetup.pysdisttwineupload-rpypidist/*Clean upfind.-typef-name"*.pyc"|xargsrm
find.-typed-name"__pycache__"|xargsrm-r
rm-r.pytest_cache
rm-r.venvSupportPleaseopen an issuefor support.ContributingPlease contribute usingGithub Flow. Create a branch, add commits, andopen a pull request.AcknowledgementsThe "Evidence" project was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) -433249742(GU 798/27-1; GE 1119/11-1).Maintenancetill 31.Aug.2023 (v0.2.0) the code repository was maintained within the DFG project433249742since 01.Sep.2023 (v0.3.0) the code repository is maintained by Ulf Hamster.