Saravanan666/pypi-org huggingface dataset:
Package: cheapi
Cheapi (cheap API)Lightweight wrapper to cache expensive function results in-memory or on disk.InstallationpipinstallcheapiUsagefromcheapiimportCachingWrapperimportopenaidef_ask_chatgpt(prompt):res=openai.ChatCompletion.create(model="gpt-4",messages=[{"role":"system","content":"You are a helpful assistant for a software engineer."},{"role":"user","content":prompt}],temperature=0,timeout=10,)choice,*_=res["choices"]usage=res["usage"]["total_tokens"]print(f"OpenAI usage:{usage}")result=choice["message"]["content"]returnresultash_chatgpt=CachingWrapper(_ask_chatgpt,cache_backend="memory")foriinrange(2):print(ash_chatgpt("Write a short joke about caching?")+"\n")or even simpler:fromcheapiimportcached@cached(cache_backend="memory")defask_chatgpt(prompt):...foriinrange(2):print(ask_chatgpt("Write a short joke about caching?")+"\n")Caching backendsUsing memory backend is mostly equivalent to usingfunctools.lru_cachebut with more configuration.
SQLite backend is useful for persistent caching, and is similar tojoblib.Memory.
Cloud backend is being dreamed of, but not implemented yet.Why?NIH+ so I couldRIIRlater.
Package: cheaquiHelloWorld
Hello WorldThis is an example project demonstrating how to publish a python module to PyPIInstallationRun the following to install:'''python
pip install cheaquiHelloWorld
'''Usage'''python
from cheaquiHelloWorld import say_helloGenerate "Hello, World!"say_hello()#Generate "Hello, Everybody!"
say_hellow("Everybody")
'''Developing Hello WorldTo install cheaquiHelloWorld, along with the tools you need to develop and run test, run the following in your virtualenv:'''bash
$ pip install -e . [dev]
'''
Package: cheat-ext
An extension ofcheatProvide simple methodology to extends cheatsheetsInstallpip install cheat-extUsageDownload cheatsheets from githubThis command will clone github respository to~/.cheat/.ext/author_repositoryand will also add symbolic link from~/.cheat/cmdto~/.cheat/.ext/author_repository/cmd# installed cheatsheets from github repository
cheat-ext install chhsiao90/cheatsheets-java
# then use cheat to display the cheatsheet defined in the cheatsheets repository
cheat cmdAvailable cheatsheetschhsiao90/cheatsheets-java: Cheatsheets for Java
Package: cheathit
CheatHit: plagiarism detection tool for programming assignmentsInstallationInstallPython3.9 or higher, then run:pipinstallcheathitUsageRunningRun CheatHit as follows:cheathit/submission/directoryOr withparameters:cheathit/submission/directory--path=group/student/problem/attempt--min-ngram=3--max-ngram=10--min-ratio=0.5--max-clique=4Or, if you want to save results to a file:cheathit/submission/directory>/path/to/fileParameters--pathSpecify the structure of the submission directory with this parameter. Use thestudent,group,problem, andattemptsections separated with slashes, e.g.,group/group/student/problem/problem/attempt. Each subsequent section gets CheatHit one level down the directory tree; the last level must be a file containing the submission.studentcorresponds to the set of programs submitted by an individual student;groupcorresponds to a group of students such that cheating is likely to take place within such a group (e.g., a school class);problemcorresponds to a separate task shared by the students;attemptcorresponds to a separate submission of a student.Thestudentsection is required (i.e., there should be at least one of these in--path); the other three sections are optional. If the same section appears in--pathmultiple times, CheatHit will simply concatenate its values to obtain the “true” representation of the section.The default value of--pathisstudent, which is suitable for cases when there is a single directory with many files, one file per student.--min-ngramMinimum ngram size (number of consecutivetokens) to analyze across the submissions.The default value of--min-ngramis1.--max-ngramMaximum ngram size (number of consecutivetokens) to analyze across the submissions.The default value of--max-ngramis20.--min-ratioMinimum ratio of the number oftokensshared by two submissions to the number of tokens in the longer of the submissions required so that the pair is included in the report.The default value of--min-ratiois0.2.--max-cliqueIf an ngram (a sequence oftokens) occurs in submissions of more than--max-cliquestudents (or in submissions of students from more than--max-cliquegroups), it is not considered distinctive.The default value of--max-cliqueis:2if students are assigned groups (--pathincludesgroup),5otherwise.TokenizationCheatHit tokenizes source code into alphanumeric words (which can also contain underscores) and non-alphanumeric characters. Whitespace, semicolons, and commas are ignored. Two special markers,<START>and<END>, are added to the beginning and end of a token sequence. Hence,CheatHit supports C++, Python v2 & v3, and _even_ VB.NET; awesome!would be tokenized as['<START>', 'CheatHit', 'supports', 'C', '+', '+', 'Python', 'v2', '&', 'v3', 'and', '_even_', 'VB', '.', 'NET', 'awesome', '!', '<END>']ResultsFor each pair of students CheatHit will report how much code is shared between the students while adjusting for how distinctive the shared code is. See theParametersandTokenizationsections above for an insight into what CheatHit considers distinctive.
Package: cheat-sh
cheat_shthehttp://cheat.shnon official lightweight wrapperexamplecheat_sh.ask()importcheat_sh# ask questionprint(cheat_sh.ask('reverse list in python'))# you can provide the languageprint(cheat_sh.ask('reverse list','python'))# by default, colors are removed because it is not helpfull if you dont print it on a terminal# but you can let themprint(cheat_sh.ask('echo',color=True))cheat_sh.learn()importcheat_sh# access cheat.sh/lang/:learnprint(cheat_sh.learn('python'))# same as ask for the colorsprint(cheat_sh.learn('python',color=True))cheat_sh.get_base_url()>>>importcheat_sh>>>cheat_sh.get_base_url()http://cheat.sh/cheat_sh.get_supported_language()>>>importcheat_sh>>># hard coded list>>>cheat_sh.get_supported_language()[...]
Package: cheatsheets
CheatsheetsAn tool  to cheatExplore the docs »View Demo·Report Bug·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageRoadmapContributingLicenseContactAcknowledgementsAbout The ProjectWhit this tool you could create cheatsheets of commands in order to can execute again easely.Probably you needed some bash command in order to do any task, and you search again any time that you need. Now you can only save as a cheatsheets and use this tool in order to execute againBuilt WithPythonGetting StartedThis is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.PrerequisitesYou need have installed python and pip v3.sudoaptinstallpython3python3-pipInstallationpipinstallcheatsheetsUsageEach cheatsheets that you want to store, is a json file with the name that you want, in~/.cheatsheetsA cheat following the next format:cheat.json{"name":"List content","command":"ls","description":"List content in directory"}If you want to put any argument in order to remplace when execute the cheatsheets, you can do it puting the name of the argument betwen<name of arg>cheat.json{"name":"List content","command":"ls <ls> <directory>","description":"List content in directory"}after this you can list your cheatsheets withcheatsheetsRoadmapSee theopen issuesfor a list of proposed features (and known issues).ContributingContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make aregreatly appreciated.Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull RequestLicenseDistributed under the MIT License. SeeLICENSEfor more information.ContactProject Link:https://github.com/Tlalocan/cheatsheetshttps://github.com/Tlalocan/cheatsheets
Package: chebpy
chebpy======**chebpy** is a python package for spetral methods of PDEs based onChebyshev series.Quickstart----------1. Install^^^^^^^^^^::$ easy_install chebpyor::$ tar -xvf chebpy-xxx.tar.gz$ cd chebpy-xxx$ python setup.py installRequired packages:* `numpy`: chebpy heavily depends on numpy.* `scipy`: advanced algorithms, such as scipy.fftpack.dct.2. APIs^^^^^^^^Current available functions:**Chebyshev series construction*** cheb_polynomial_recursion* cheb_polynomial_trigonometric* cheb_polynomial_series**Fast Chebyshev transform*** cheb_fast_transform* cheb_inverse_fast_transform**Chebyshev differentiation*** cheb_D1_mat* cheb_D1_fft* cheb_D1_dct* cheb_D1_fchebt**Chebyshev interpolation*** cheb_interpolation_point* cheb_interpolation_1d* cheb_interpolation_2d**Chebyshev quadrature*** cheb_quadrature_clencurt* cheb_quadrature_cgl**Chebyshev applications in solution of PDEs*** cheb_mde_split* cheb_mde_neumann_split* cheb_mde_etdrk4* cheb_mde_neumann_etdrk4* cheb_mde_robin_etdrk4* cheb_allen_cahn_etdrk4Ask for Help------------* You can directly contact me at liuyxpp@gmail.com.* You can join the mailinglist by sending an email to chebpy@librelist.comand replying to the confirmation mail.To unsubscribe, send a mail to chebpy-unsubscribe@librelist.comand reply to the confirmation mail.Links-----* `Documentation <http://pypi.python.org/pypi/chebpy>`_* `Website <http://ngpy.org>`_* `Development version <http://bitbucket.org/liuyxpp/chebpy/>`_
Package: cheby
chebyThis package provides:Basis of Chebyshev polynomials of the first kindFunctions represented as Chebyshev seriesIt is intended to be used for the resolution of differential equations using spectral methods.
It is primarily a C++ library with a Python wrapper usingpybind11.
It also relies onEigenfor linear algebra.InstallationThe simplest way is to usepip:pipinstallchebyThe package can be installed directly from source:gitclonehttps://github.com/GwenaelGabard/chebycdcheby
gitsubmoduleupdate--init--recursive
pipinstall.This will require a C++ compiler andcmake.UsageThe Python classBasis1Dprovides the following features:Evaluation of Chebyshev polynomials of the first kind and their derivativesChebyshev points of the first and second kindsDifferentiation matrixMatrix for Dirichlet recombinationThe Python classesRealFunctionandComplexFunctionprovide representations of univariate functions as Chebyshev series.
THey provide the following features:Construction of the Chebyshev representation based on a Python functionEvaluation of the function and its derivativesAddition, subtraction and multiplicationPrimitive and integrals (over the whole domain or over a subsegment)Roots and extremaInteger powersSee the Jupyter notebooks in theexamplesfolder for examples of usage.Unit testsUnit tests are written usingpytest.
They can be run usingpytesttestsLicenseThis project is licensed under the MIT License - see theLICENSEfile for details
Package: chebyfit
Chebyfit is a Python library that implements the algorithms described in:Analytic solutions to modelling exponential and harmonic functions using
Chebyshev polynomials: fitting frequency-domain lifetime images with
photobleaching. G C Malachowski, R M Clegg, and G I Redford.
J Microsc. 2007; 228(3): 282-295. doi: 10.1111/j.1365-2818.2007.01846.xAuthor:Christoph GohlkeLicense:BSD 3-ClauseVersion:2024.1.6QuickstartInstall the chebyfit package and all dependencies from thePython Package Index:python -m pip install -U chebyfitSeeExamplesfor using the programming interface.Source code and support are available onGitHub.RequirementsThis revision was tested with the following requirements and dependencies
(other versions may work):CPython3.9.13, 3.10.11, 3.11.7, 3.12.1NumPy1.26.3Revisions2024.1.6Support Python 3.12.2023.4.22Drop support for Python 3.8 and numpy < 1.21 (NEP29).2022.9.29Add type hints.Convert to Google style docstrings.2022.8.26Update metadata.Remove support for Python 3.7 (NEP 29).2021.6.6Fix compile error on Python 3.10.Remove support for Python 3.6 (NEP 29).2020.1.1Remove support for Python 2.7 and 3.5.2019.10.14Support Python 3.8.Fix numpy 1type FutureWarning.2019.4.22Fix setup requirements.2019.1.28Move modules into chebyfit package.Add Python wrapper for _chebyfit C extension module.Fix static analysis issues in _chebyfit.c.ExamplesFit two-exponential decay function:>>> deltat = 0.5
>>> t = numpy.arange(0, 128, deltat)
>>> data = 1.1 + 2.2 * numpy.exp(-t / 33.3) + 4.4 * numpy.exp(-t / 55.5)
>>> params, fitted = fit_exponentials(data, numexps=2, deltat=deltat)
>>> numpy.allclose(data, fitted)
True
>>> params['offset']
array([1.1])
>>> params['amplitude']
array([[4.4, 2.2]])
>>> params['rate']
array([[55.5, 33.3]])Fit harmonic function with exponential decay:>>> tt = t * (2 * math.pi / (t[-1] + deltat))
>>> data = 1.1 + numpy.exp(-t / 22.2) * (3.3 - 4.4 * numpy.sin(tt)
...                                          + 5.5 * numpy.cos(tt))
>>> params, fitted = fit_harmonic_decay(data, deltat=0.5)
>>> numpy.allclose(data, fitted)
True
>>> params['offset']
array([1.1])
>>> params['rate']
array([22.2])
>>> params['amplitude']
array([[3.3, 4.4, 5.5]])Fit experimental time-domain image:>>> data = numpy.fromfile('test.b&h', dtype='float32').reshape((256, 256, 256))
>>> data = data[64:64+64]
>>> params, fitted = fit_exponentials(data, numexps=1, numcoef=16, axis=0)
>>> numpy.allclose(data.sum(axis=0), fitted.sum(axis=0))
True
Package: check
# Check[![Build Status](https://travis-ci.org/bcho/check.svg)](https://travis-ci.org/bcho/check)Check your server like a boss.## Usage```bash$ check -c config.json```## Config.json```json{"in_charge": [{"name": "Travis Bickle","email": "travis.bickle@example.com"},{"name": "Besty","email": "besty@example.com"}],"reporters": {"email": {"crendential": {"username": "watchmen@example.com","password": "watchmen-passw0rd","smtp": "smtp.example.com:587"},"formats": {"short": "Site {site['name']} is down!","long": "Your site {site['name']} is down since {happened_at}!"}},"cli": {"formats": {"short": "Site {site['name']} is down!","long": "Check time: {happened_at}"}}},"sites": [{"name": "My Cool Site","url": "http://cool.example.com"},{"name": "Goole is Down","url": "https://google.com"}]}```### `in_charge`Specify list of people you want to notify when a incident happened here.##### Fields:| name | description | required? ||:------:|:-------------:|:-----------:|| name | alias name | yes || email | receiver's email address | no |- `email`: If user's `email` is provided, they will receive a warning email for the incident.### `reporters`Enabled report generators. Each generator can customize the `incident report` format.##### Report Format Fields| name | description | required? ||:------:|:-------------:|:-----------:|| short | summarize report | yes || long | detailed report | yes |Each `incident report` will contain:- site name- site url- incident happened time string, format is [ISO8601][iso8601].```pythonincident_report = {'site': {'name': 'test','url': 'http://test.domain'},'happened_at': '2014-11-01T15:42:00.000000+00:00'}```[iso8601]: http://en.wikipedia.org/wiki/ISO_8601#### Email HandlerIf you want to use email handler, you should provide email sender's crendentialsettings.##### Fields:| name | description | required? ||:------:|:-------------:|:-----------:|| username | login name | yes || password | login password | yes || smtp | smtp server | yes |### `sites`List of sites you want to monitor.##### Fields:| name | description | required? ||:------:|:-------------:|:-----------:|| url | site's url | yes || name | alias name | no, defaults to `url`|## TODO- [ ] refine data structure.- [ ] add more check methods (like ping).## LICENSESee [LICENSE.md](LICENSE.md).# Changelog## 0.1 小光棍节 Mr. Single, Jr. (2014/11/1)- Initial version.
Package: check4updates
check4updatesis a Python package designed for developers to provide a reliable, simple, and unobtrusive way to check whether their users have the most recent release of their package installed and prompt users when an update is available.It is recommended thatcheck4updatesbe placed in your packageâ€™s__init__.pyfile so that it is called every time the package is used. To minimise runtime,check4updatesonly checks online if certain conditions are met, such as sufficient time since the last check. This ensures that incorporatingcheck4updatesinto your Python package will have a negligible (<0.01sec) effect on the time it takes users to import something from your package (which is when__init__.pyis called) and no impact on any of the functions within your package.Whencheck4updatesdoes check online, it searches PyPI for the most recent release (based on version number) and compares that value with the version installed on the userâ€™s system. If certain conditions are met, the user is then prompted to install the updated version which must be done by the user in a separate command so as not to interrupt the currently executing script. Users can choose to upgrade now, skip this version, be reminded later, or never be asked again andcheck4updateswill remember this choice and act accordingly.DocumentationDetailed documentation and examples are available atreadthedocs.Design principlesperiodically check for updates without user action and without slowing down the parent scriptonly prompt the user when necessarygive the user the option to update now, be reminded later, skip this version, or never be asked againhandle all errors silently to prevent the parent script from being impactedUsageTo usecheck4updates, place the following lines in your package's__init__.pyfile:fromcheck4updatesimportcheck_and_promptcheck_and_prompt("your_package")It is as simple as that andcheck4updateswill do the rest!ContactIf you find any errors, have any suggestions, or would like to request that something be added, please emailalpha.reliability@gmail.com.If you would like to receive an email notification when a new release ofcheck4updatesis uploaded to PyPI,NewReleases.ioprovides this service for free.
Package: check50
# check50check50 is a testing tool for checking student code. As a student you can use check50 to check your CS50 problem sets or any other Problem sets for which check50 checks exist. check50 allows teachers to automatically grade code on correctness and to provide automatic feedback while students are coding.You can find documentation and instructions for writing your own checks athttps://cs50.readthedocs.io/projects/check50/.
Package: check50-checkstyle
check50_checkstyleThis is an extension for theCS50 automarker check50that allows to run the static code analysercheckstyleand interpret the resulting XML report as check50 Failures.Checkstyle let's you complain about style issues, particularly in Java code, beyond whatstyle50(astyle) can do.
For instance you can flag if identifiers don't adhere to Java's camelCase code conventions, or javadocs are missing.For convenience, this package ships with the stand-alone CLI of checkstyle (checkstyle-8.35-all.jar), which is why it is so large.Example UsageYou need to import this module into your problem set (__init.py__):importcheck50_checkstyleand declare#- check50-checkstyleit as a dependency in your.cs50.ymlfile:check50:
  dependencies:
    - check50-checkstyleCheckstyle needs an XML style definition file to run.
The jar file contains two such definitions, following the sun or google style guides but both are rather "picky",i.e., complain about lots of minor stuff. Pick one of these style files and delete what you don't like.Let's assume your problem set contains the style definitionstyle.xml.
Then you add a check50 check as follows. The target can be more specific of course.@check50.check(exists)defcheckstyle():"""style police"""check50.include("style.xml")check50_checkstyle.run_and_interpret_checkstyle(checks_file='style.xml',target='*.java')This will dump all warnings into the log (because check50 hard-codes its html template). Example output::( style police
    stylistic issues found
    Issues found:
    - In Credit.java(line 4, char 5): Missing a Javadoc comment.
    - In Basket.java(line 2, char 1): Wrong lexicographical order for 'java.util.ArrayList' import. Should be before 'java.util.List'.
    - In Basket.java(line 19, char 5): Missing a Javadoc comment.
    - In Basket.java(line 27, char 5): Missing a Javadoc comment.
    - In Basket.java(line 35, char 5): Missing a Javadoc comment.
    - In Basket.java(line 47): First sentence of Javadoc is missing an ending period.
    - In Item.java(line 27): Line is longer than 100 characters (found 102).
    - In Item.java(line 53, char 40): 'typecast' is not followed by whitespace.
    - In Snack.java(line 20, char 5): Missing a Javadoc comment.
Package: check50-java
check50_javaThis is an extension for theCS50 automarker check50that provides convenient wrappers aroundcheck50.runfor directly compiling and interpreting Java source/byte code.See alsocheck50_junitandcheck50_checkstylefor related utilities that make writing check50 checks for java less painful.Example UsageAll examples below assume that you're importingcheck50andcheck50_java.Compile Java source code@check50.check()defsomeclass_compiles():check50_java.compile("SomeClass.java"classpaths=['your/classpaths','relative/to/the','pset/directory.jar'])The classpaths argument defaults toNone~'.'.Check that a class is executable (has well-formed main method)@check50.check(someclass_compiles)defsomeclass_main_exists():"""SomeClass is application class"""check50_java.checks.is_application_class("SomeClass")Execute an application class and check that its output is as expected@check50.check(someclass_main_exists)defsomeclass_main_output():"""SomeClass.main() output"""expected="X"actual=check50_java.run("SomeClass").stdout()help_msg="did you introduce training newline or whitespace characters?"ifactual!=expected:raisecheck50.Mismatch(expected,actual,help=help_msg)
Package: check50-junit
check50_junitThis is an extension for theCS50 automarker check50for compiling and runningJunit5unit tests
and raising the resulting failures directly as check50 Failures to be used in checks.This module ships withJunit5's stand-alone console launcher.Your problem set only needs to include the compiled bytecode of junit test classes,
which are compiled against your model solution to the exercise.
This gets around the issue that unit tests may not compile for student's code
due to unexpected method signatures class identifiers.
Such errors will be reflected in the JUnit's report XML file.Example UsageTLDR: importcheck50_junit; add your compiled junit test classes to your pset, and usecheck50_junit5.run_and_interpret_testwithin your checks.
A full example follows.All examples below assume that you're importingcheck50andcheck50_junit.Write your model solution and unit test classes and manually compile them.publicclassDrink{privatefinalintvolume;publicDrink(intv){volume=v;}intgetVolume(){returnvolume;}import staticorg.junit.jupiter.api.Assertions.*;importorg.junit.jupiter.api.Test;classDrinkTest{@TestpublicvoidgetVolume(){Drinkd=newDrink(200);assertEquals(200,d.getVolume());}}Move the bytecodeDrinkTest.classsomewhere into your pset directory, say undertests/.Add a check as follows (I would usually have this depend on class exists, compiles, and can be instantiated checks).@check50.check()defdrink_getVolume():"""Test Drink.getVolume()"""check50_junit.run_and_interpret_test(classpaths=['tests/'],args=['--select-method','DrinkTest#getVolume'])This will run the precompiled unit test on the student submission, parse junit's XML report and raise anycheck50.Failures as appropriate for the result. In this case it would raise acheck50.Mismatchexception if theassertEqualswithin the unit test is thrown.Make sure to addcheck50-javaas a dependency in your pset's.cs50.yml:check50:
  dependencies:
    - check50-java
  files:
    - !exclude "*"
    - !include "*.java"