Saravanan666/pypi-org huggingface dataset:
Package: codep
codepA light-weight framework for defining and running dependent tasks. By building a
dependency graph between tasks, the runner makes sure that tasks that are
required by multiple dependants are only run once and reuses the results.UsageIn the example below thecalculate_circumferenceandcalculate_volumetasks
both depend on theacquire_radiusandcalculate_pitasks. The runner will
infer that from the dependency graph and run them before.importcodepimportimmutables@codep.make_partial()defacquire_radius(state:immutables.Map)->immutables.Map:returnstate.set("radius",6_371)@codep.make_partial()defcalculate_pi(state:immutables.Map)->immutables.Map:returnstate.set("pi",3.14)@codep.make_partial(depends=(calculate_pi,acquire_radius))defcalculate_circumference(state:immutables.Map)->immutables.Map:returnstate.set("circumference",2*state["pi"]*state["radius"])@codep.make_partial(depends=(acquire_radius,calculate_pi))defcalculate_volume(state:immutables.Map)->immutables.Map:returnstate.set("volume",(4/3)*state["pi"]*state["radius"]**3)if__name__=='__main__':r1,r2=codep.run(calculate_circumference,calculate_volume)circumference=r1.state["circumference"]volume=r2.state["volume"]print(f"The circumference of earth is{circumference}km and its volume is "f"{volume}km^3")TodoMake Partial a Generic, and make tasks only able to return a value.Partial.applyshould instead assign the result to the state which
becomes a mappingType[Partial] -> Any.Removeprint(), use loggingConcurrent task execution
Package: codepackager
This utility is written for easing moving source code between separated network with mobile storage.Here are the steps: (sample of .codepackager.yaml can be found in this project)1. Put .codepackager.yaml into your home folder and configurate it with your setting.The following directive can be ignored in this configuration file:* "package-name" and* "vcs"This would be your local setting. You will need local setting in remote machine, too.2. Put .codepackager.yaml into the root folder (where .hg or .git resides) of your repository.Only "package-name" is required. This setting ("package-name") will use as packaged file name.You can include other directives to customize for certain project if you really need it.This would be your project/repository setting.3. Add and commit the .codepackager.yaml in your repository.4. Run "prep_codepkg.py" in root folder of repository to package the repository (and make backup).5. Move mobile storage to remote machine.Run "recv_codepkg.py /PATH/TO/PACKAGED_FILE" in repository folder of remote machine.This step should bring configuration file to remote machine.6. From now on, you can use "recv_codepkg.py" (without path of packaged file) to pull updates from mobile storage.
Package: codepadr
codepadr is an interface to upload things tocodepad.org.Installation & RequirementsTo install codepadr, simply:$ pip install codepadror, if you must:$ easy_install codepadrcodepadr requires:python 2.6+requestsExample usagecodepadr is quite flexible in how you pass it code to upload:$ codepad file.txt
$ codepad < file.txt
$ cat file.txt | codepadYou can specify that the paste should be private:$ echo "psst, this is private" | codepad -pYou can specify the language of the paste (defaults to plain text):$ echo "print 'hello world'" | codepad -l pyIf you pass in a file, the language will be inferred from the file extension:$ codepad script.rbYou can ask codepad the run the code:$ codepad script.py -rAnd if you pass in-, it will read from stdin:$ codepad -l py -r -
for i in xrange(25):
    print i**i
^DCreditsThis project was inspired by Dalton Barreto’scodepad.
Package: code-parser
Code_parserCode parser is a first Otus homework.
It'll give some stats on your project: total number of unique words, most common word, functions and most common word in functions.
##Installation
Use the package managerpipto install Code parser.pip install code_parser##Usagepython3 -m code_parser [-p PROJECT_PATH] [-e EXCLUDET_DIRS]##Examplepython3 -m code_parser -p /User/myproject/new_project -e venv,some_lib,other_libFound 22 functions
Most common is get, used 6 times
Found 309 words, unique 55
Most common is names, used 44 times##Requirementsnltk==3.4.1six==1.12.0
Package: codepeers
codepeersCodepeers JupyterLab extension to review code from your peers.This extension is composed of a Python package namedcodepeersfor the server extension and a NPM package namedcodepeersfor the frontend extension.Design docsSeeSystem DesignRequirementsJupyterLab >= 3.0InstallTo install the extension, execute:pipinstallcodepeersUninstallTo remove the extension, execute:pipuninstallcodepeersTroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the codepeers directory# Install package in development modepipinstall-e"."# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Server extension must be manually installed in develop modejupyterserverextensionenablecodepeers# Rebuild extension Typescript source after making changesjlpmbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstall# Server extension must be manually disabled in develop modejupyterserverextensiondisablecodepeers
pipuninstallcodepeersIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedcodepeerswithin that folder.Packaging the extensionSeeRELEASE
Package: codepiper
codepiperThis tool provides some utilities for working with AWS CodePipeline:watch- Monitor a pipeline for executions and also follow CodeBuild logs.debug- Run stage with debug mode enabled.verify_clear- Verify that a pipeline is clear, or the details if not.rollback- Rollback a stage of a pipeline to a prior execution.WatchTo monitor all active executions for a pipeline:codepiper --profile toolchain --region us-west-2 watch -p my-pipeline-nameTo monitor a pipeline along with logs from CodeBuild:codepiper --profile toolchain --region us-west-2 watch -p my-pipeline-name -fTo monitor one specific execution for a pipeline:codepiper --profile toolchain --region us-west-2 watch -p my-pipeline-name -e 20b20f00-f63d-4b05-8921-20a4fc16090ecodepiper --profile toolchain --region us-west-2 verify_clear -p my-pipeline-nameDebugView a running build in Session ManagerYou will need to add thecodebuild-breakpointcommand in the buildspec where you want to pause execution. When you are done debugging runcodebuild-resumein the CLI to resume the build.The debug option will output a codebuild URL for the build. Once the build is PROVISIONED there will be an SSM Session link to follow to get CLI access.To run a pipeline stage in debug mode:codepiper --profile toolchain --region us-west-2 debug --pipeline my-pipeline-name --stage IntegrationTo run a pipeline stage in debug mode with new or overridden env vars:codepiper --profile toolchain --region us-west-2 debug --pipeline my-pipeline-name --stage Integration --envvar JAVA_OPTS="-Xmx1g -Dproperty=value" --envvar JAVA_VAR1=new_valueRollbackTo rollback a pipeline stage to last successful execution:codepiper --profile toolchain --region us-west-2 rollback -p my-pipeline-name -s ProductionTo rollback a pipeline stage to a specific commit id:codepiper --profile toolchain --region us-west-2 rollback -p my-pipeline-name -s Production -c af32c18To rollback a pipeline stage and watch logscodepiper --profile toolchain --region us-west-2 rollback -p my-pipeline-name -s Production -fVerify Pipeline ClearTo verify that a pipeline is currently clear:codepiper --profile toolchain --region us-west-2 verify_clear --pipeline my-pipeline-nameInstallationUse theupgradeflag to ensure you have the latest version.pip install codepiper --upgradeLimitations$CODEBUILD_RESOLVED_SOURCE_VERSIONis unavailable since the CodeBuild execution is not initiated via CodePipeline. The workaround for this is to useCodePipeline Variablesto pass theCommitIdfrom source stage as a user defined environment variable to your CodeBuild project.
Package: codeplateau
codepleateau documentation 😃.Is a cli tool written in python that has these functionalityLink up with codeplateau online.Generating stater project files.Installation guidepipinstallcodeplateauUsage guideGetting help on how to use the tool.codeplateau--helpGenerating stater codecodeplateaucreate<projectname>Type one of the following option on the promptExpected optionspythoncc++javawebLinking up with codeplateau online.codeplateauconnectType one of the following option on the promptExpected optionsfacebooktwitterinstagram
Package: co-deployer
Co-DeployerCo-Deployer is a tool made to deploy your projects simply and quickly. You can deploy your projects to a server using FTP or SFTP and also you can run commands on the server using SSH.InstallationYou can install Co-Deployer using pip:pipinstallco-deployerUsageTo use Co-Deployer you need to create a file nameddeploy.config.jsonin the root of your project. This file contains the configuration of your hosts and all the deployments you can use.Configuration fileThe file is structured in two parts:hostsanddeployments.{"hosts":[],"deployments":[]}HostsThe hosts are the servers where you want to deploy your project. You can define as many hosts as you want. Each host has a name and the credentials to connect to the server, the credentials can be shared for ftp/sfp and ssh connections or you can define different credentials for each connection type.Only thenameandhostfields are required, the rest are optional."hosts":[{"name":"my_host","host":"my-host.com","username":"user","password":"password","ftp":{"hostname":"my-ftp-host.com","username":"my-ftp-user","password":"very-secure-password","port":21},"sftp":{"hostname":"my-sftp-host.com","username":"my-sftp-user","password":"very-secure-password","port":22},"ssh":{"hostname":"my-ssh-host.com","username":"my-ssh-user","password":"very-secure-password","port":22}}]DeploymentsThe deployments are the tasks that you want to run on the server. You can define as many deployments as you want.Here 4 fields are required:name,host,argandprotocol. Thenameis the name of the deployment, thehostis the name of the host where you want to deploy, theargis the argument that will trigger the deployment and theprotocolis the protocol that you want to use to deploy your project. Theprotocolcan beftp,sftp.Thelocal_pathis the path of the folder that you want to deploy, theremote_pathis the path of the folder where you want to deploy your project. Theexcludeis an array of files and folders that you want to exclude from the deployment.Thecmdis an object that contains the commands that you want to run on the server. All the fields are optional. Thecmdis the command that you want to run localy, thesshis the command that you want to run on the server using ssh. Thebeforeandafterare the commands that you want to run before and after the deployment. Thessh_beforeandssh_afterare the commands that you want to run before and after the deployment using ssh."deployments":[{"name":"react frontend build and deployment","host":"my_host","arg":"-fb","protocol":"sftp","local_path":"","remote_path":"/var/www/html","exclude":[],"cmd":{"cmd":"","ssh":"","before":"npm run build","after":"","ssh_before":"","ssh_after":"",}}]
Package: codeplug
Read and write Motorola Codeplugs (.ctb) from the commandline.Getting Startedpip install codeplug # or download from above
# set the keys in codeplug.cfg
codeplug decode yourfile.ctb
# modify yourfile.ctb.xml
codeplug build yourfile.ctb.xmlNote:If you own a copy of MOTOTRBO CPS, you can usecodeplug-prepareto extract the keys.
Package: codepoints
Unicode Code Points for PythonUntil Python 3.3, the Python runtime could be compiled in one of two Unicode modes:sys.maxunicode == 0x10FFFFIn this mode, Python’s Unicode strings support the full range of Unicode code points from U+0000 to U+10FFFF. One code point is represented by one string element:>>> import sys
>>> hex(sys.maxunicode)
'0x10ffff'
>>> len(u'\U0001F40D')
1
>>> [c for c in u'\U0001F40D']
[u'\U0001f40d']This is the default for Python 2.7 on Linux, as well as universally on Python 3.3 and later across all operating systems.sys.maxunicode == 0xFFFFIn this mode, Python’s Unicode strings only support the range of Unicode code points from U+0000 to U+FFFF. Any code points from U+10000 through U+10FFFF are represented using a pair of string elements in the UTF-16 encoding:>>> import sys
>>> hex(sys.maxunicode)
'0xffff'
>>> len(u'\U0001F40D')
2
>>> [c for c in u'\U0001F40D']
[u'\ud83d', u'\udc0d']This is the default for Python 2.7 on macOS and Windows.This runtime difference makes writing Python modules to manipulate Unicode strings as series of codepoints quite inconvenient.The codepoints moduleThis module solves the problem by exposing APIs to convert Unicode strings to and from lists of code points, regardless of the underlying setting forsys.maxunicode:>>> hex(sys.maxunicode)
'0xffff'
>>> snake = tuple(codepoints.from_unicode(u'\U0001F40D'))
>>> len(snake)
1
>>> snake[0]
128013
>> hex(snake[0])
'0x1f40d'
>>> codepoints.to_unicode(snake)
u'\U0001f40d'
Package: codepost
codePost API Python SDKThis package provides a Python library to conveniently access the codePost API
from any application or script written in the Python language.You can learn more aboutcodePost, the best tool for educational code feedback, or
check out the documentation for powerful, best-in-classREST APIthat
this Python SDK allows you to control.You can also dive in directly with thecodePost API Python SDK cheatsheet.QuickstartThis section provides a quick overview of how to install the library and getting started, for more complete
information, you can reference ourFirst Steps with the codePost API Python
SDK.This codePost API Python SDK is available on the Python package manager PyPi, and can be installed from all
usual sources, such as withpip:sudopipenvinstallcodepostYou can also install the package just for your account (pip install --user codepost) or using a tool such
aspipenvwhich will install the library in a virtual environment (pipenv install codepost).Once you've import thecodepostpackage, you need to configure it with the API key you've obtained
fromyour Settings page(for other means of setting the API key,read here):importcodepostcodepost.configure_api_key("ddafde24389de98434f8df3ee482389de98432afde24482f3428923491344f8df3eef34892349134")You can then directly access the codePost objects:course=codepost.course.list_available(name="CS101",period="Spring 2020")[0]assignment=course.assignments.by_name("Hello World")submissions=assignment.list_submissions()forsubmissioninsubmissions:print("{student},{grade}",student="+".join(submission.students),grade=submission.grade)to print the grades of all submissions of the assignment"Hello World"of the course CS101 in Spring 2020.DevelopmentThe codePost API Python SDK is under active development. At this time, we are welcoming all
issues, suggestions and feature requests. Please eitherpost a GitHub issue on this
repository, orjoin our Gitter
channelto ask a question.Running testsTo start developing, installpipenv, then install
all dependencies (including development dependencies, with the flag--dev) for this project:git clone https://github.com/codepost-io/codepost-python
cd codepost-python
pipenv install --devRun all tests on all supported versions of Python which you have locally installed:make testRun all tests for a specific Python version (modify-eaccording to your Python target):pipenv run tox -e py37Run all tests in a single file for a specific Python version:pipenv run tox -e py37 -- tests/util/test_misc.py
Package: codePost-api
codePost API Python LibraryThe package provides a set of helper functions used to access the codePost API from applications written in the Python language.DocumentationThis library implements helper methods to access the codePost API. Check out thePython version of the codePost API docs.InstallationThe recommended method to install this codePost API Python library, is to use pip:pip install codePost-apior for local development:pip install --user codePost-apiUsageTo use the functions available in this library, you must have a codePost API key. As of March 2019, to retrieve a codePost API key, you must be a administrator of a course on codePost. It will then be accessible fromhttps://codepost.io/settings.DevelopmentTo start developing, installpipenv, then install all dependencies for this project:pipenv install --devRun all tests on all supported versions of Python which you have locally installed:make testRun all tests for a specific Python version (modify-eaccording to your Python target):pipenv run tox -e py27Run all tests in a single file for a specific Python version:pipenv run tox -e py27 -- tests/test_helpers.py
Package: codepost-powertools
Some helpful codePost tools to aid with grading flow using thecodePostSDK!These tools were originally created to support the grading process for COS126,
the introductory Computer Science course at Princeton University.DocumentationThe documentation can be foundhere.Installation$pipinstallcodepost-powertoolsUsagePlease see the documentation for a more detailed description of the usage.You should have a dedicated folder for the usage of these tools, since it
requires an input config file and outputs files for certain commands /
functions. It is recommended to use a virtual environment for this:$python-mvenvenv$sourceenv/bin/activate(env)$python-mpipinstallcodepost-powertools(env)$cptools--help(env)$pythonmy_script.pyBy default, the package will look for a configuration file calledconfig.yamlthat contains a field"api_key"for your codePost API key.
Seethis pagefor instructions on how to access your codePost API key, as well as more
information on the config YAML file. You must have admin access to all the
courses you wish to access with this package.Command Line UsageYou can access the command-line interface with thecptoolscommand:$cptools--helpUsage:cptools[OPTIONS]COMMAND[ARGS]...The`codepost_powertools`packageonthecommandline.Please see the CLI documentation for more information.Script UsageYou can import the package in a script:importcodepost_powertoolsascptools# Log in to codePostcptools.log_in_codepost()# Call methodsPlease see the “Writing Scripts” documentation for more information.
Package: codepost-stats
codePost Statistics CompilerA system to compile statistics automatically from a course on the codePost platform.InstallationThe package is available on PyPI as slacktivate and so is available the usual way, i.e.,$pipinstallcodepost-statsExampleimportcodepostimportcodepost_statsimportcodepost_stats.analyzers.abstract.simpleimportcodepost_stats.analyzers.standardimportcodepost_stats.event_loop# Logincodepost.configure_api_key("<CODEPOST_API_TOKEN>")# Create Course Analyzer Event Loopcael=codepost_stats.event_loop.CourseAnalyzerEventLoop(course_name="COS126",course_term="S2020",)# Create AnalyzerclassSubmissionsGradedCounter(codepost_stats.analyzers.abstract.simple.CounterAnalyzer):_name="submissions.graded"def_event_submission(self,assignment:codepost.models.assignments.Assignments,submission:codepost.models.submissions.Submissions,):# if no grader, nothing to doifsubmission.graderisNone:return# if not finalized, do not want to count itifnotsubmission.isFinalized:return# increase number of graded submission for grader by 1self._delta_counter(name=submission.grader,subcat=assignment.name,delta=1,)sgc=SubmissionsGradedCounter()# Add the analyzer we just createdcael.register(sgc)# Add a few standard analyzerscael.register(codepost_stats.analyzers.standard.CustomCommentsCounter)cael.register(codepost_stats.analyzers.standard.RubricCommentsCounter)# Run the aggregation of statscael.run()# Extract statistics per userstatistics_per_user={name:cael.get_by_name(name)fornameincael.names}and thestatistics_per_uservariable would be a dictionary of the form:{"grader1@princeton.edu":{"submissions.graded":{"hello":5,"loops":6,"nbody":0,"sierpinski":8,"programming-exam-1":6,"hamming":0,"lfsr":2,"guitar":5,"markov":6,"tspp":4,"atomic":29},"comments.counter.custom":{"hello":9,"loops":6,"nbody":0,"sierpinski":14,"programming-exam-1":6,"hamming":0,"lfsr":4,"guitar":8,"markov":14,"tspp":7,"atomic":36},"comments.counter.rubric":{"hello":7,"loops":15,"nbody":0,"sierpinski":13,"programming-exam-1":8,"hamming":0,"lfsr":6,"guitar":10,"markov":17,"tspp":13,"atomic":38}},"grader2@princeton.edu":{/* ... grader2@princeton.edu's statistics here ... */},/* ... more graders ... */}LicenseThis project is licensedunder the LGPLv3 license,
with the understanding that importing a Python modular is similar in spirit to dynamically linking
against it.You can use the library/CLIcodepost-statsin any project, for any purpose,
as long as you provide some acknowledgement to this original project for
use of the library (for open source software, just explicitly includingcodepost-statsin the dependency such as apyproject.tomlorPipfileis acknowledgement enough for me!).If you make improvements tocodepost-stats, you are required to make those
changes publicly available.