Saravanan666/pypi-org huggingface dataset:
Package: codefurther
CodeFurtherTheCodeFurtherlibrary is designed to be used in UK schools to provide students with access to data that hopefully
has some relevance for them. The hope is that by gaining access to meaningful data, they will be inspired toCodeFurther.CodeFurtheris under active development
and is licensed under theApache2 license,
so feel free tocontributeandreport errors and suggestions.NoteTheCodeFurtherpackage is designed to be used in UK schools to provide programmatic access to data that
describes the UK Top 40 singles and albums. The hope is that by providing simple interfaces to access
information that students may have an interest in, they may be inspired toCodeFurther.
This documentation will therefore most likely be aimed at teachers and education professionals, who may not have a
deep knowledge of Python.WarningCodeFurtheris currently designed to work with Python version 3. I have recently carried out some work to make
it run on Python 2 too, but this does need to be more thoroughly tested that my current Nose tests allow. If youencounter any issues, or you’d like tosubmit a pull
request, please contact me on BitBucket.Modules in the PackageCodeFurthercontains a number of modules that provide access tointerestingdata. Those modules are shown below:CodeFurther ModulesModuleDescriptiontop40Provides access to the UK Top 40 charts for singles and albums.lyricsAllows lyrics for a given artist and song title to be accessed within Python.directionsAllows Google Maps route directions to be accessed from within Python.FeaturesCodeFurtherprovides:a list of the current Top 40 UK singles using thesingles <top40.Top40.singles>property of the~top40.Top40class.a list of the current Top 40 UK albums using thealbums <top40.Top40.singles>property of the~top40.Top40class.the ability to retrieve the lyrics for a given artistthe ability to find all of the songs for a given artistthe ability to search for a specific artistInstallationCodeFurthercan be found on the Python Package IndexPyPi here.It can be installed usingpip, like so.pip install codefurtherDocumentationThe documentation forCodeFurthercan be found on theReadTheDocs site.TestsTo run theCodeFurthertest suite, you should install the test and development requirements and then run nosetests.$pipinstall-rdev-requirements.txt$noseteststestsChangesSeeChanges <changes>.
Package: codeg
codegCodeg (code generator) is a python library that allows you to generate python code dynamically.This library is still a work in progressDemonstrationCreate simple classLet's say you want to generate the following class dynamicallyclassAnimal:def__init__(self,name:str):self.name=nameYou can use the following codeimportcodeg# Create the 'Animal' classcode_cls=codeg.cls("Animal")# Add the init methodcode__init=code_cls.method("__init__",parameters=[codeg.param("name",annotation=str)])# Add a simple instructioncode__init.line("self.name = name")# Print the generated codecode_cls.print()# Get the generated code in a variablescript=code_cls.generate_code()# Eval the code and get it on a variableAnimal=code_cls.build()# Create an instance of our dynamically generated clsanimal=Animal("rex")print(animal)Generate scriptIt is possible to generate and execute a scriptdefdouble(i):x=i*2returnxforiinrange(10):print(double(i))Dynamically generate the script aboveimportcodeg# Create a new empty scriptcode_script=codeg.script()# Create the 'double' functioncode_function=code_script.function("double",["i"])code_function.line("x = i * 2")code_function.return_("x")# Create the 'for' loopcode_forloop=code_script.for_("i","range(10)")code_forloop.line("print(double(i))")# Execute the scriptbuild_dict=code_script.build()# Get the 'double' functiondouble=build_dict["double"]It is possible to chain the methods in the same line, since the methodslineandreturnwill return the current object:# We can replace the generation of function with the following codecode_script.function("double",["i"]).line("x = i * 2").return_("x")By chaining the methods we can have the same script with less code:importcodeg# Create a new empty scriptcode_script=codeg.script()# Create the 'double' functioncode_script.function("double",["i"]).line("x = i * 2").return_("x")# Create the 'for' loopcode_script.for_("i","range(10)").line("print(double(i))")# Execute the scriptbuild_dict=code_script.build()# Get the 'double' functiondouble=build_dict["double"]
Package: codegaze
CodeGaze [Beta]: A library for evaluating and debugging code generation modelsStill in development.Code gaze implements a set of evaluation metrics and visualization tools for debugging code generation models.CodeGaze is build around a set of abstractions that allow for the evaluation of code generation models.Dataset: An example code generation dataset e.g. humaneval.Experiment: A set of parameters that define the evaluation of a code generation model. Each experiment specifies things like the dataset, model properties (temperature, n_completions), and some metric properties.Model: A code generation model that can be evaluated. This is either an OpenAI model or a HuggingFace model.The basic starting point is to run an experiment on a dataset with a list of models.Installationpipinstallcodegaze
Package: code_genie
code-genieThis library is your copilot for jupyter notebooksLatest version: 0.3.1DocumentationStarter NotebookAll ExamplesAPI DocumentationInstallationpipinstallcode-genieAccess TokenYou need your unique access token to use this library. You can get your access token
by signing up herehereUsageSetting environment variablesOn the top of your notebook, set an environment variable calledCODE_GENIE_TOKENas your access token. This can
be done in a couple of ways:Using env magic%env CODE_GENIE_TOKEN=xxxkeyxxxUsing dotenvYou can use thepython-dotenvpackage.from dotenv import load_dotenv
load_dotenv("path-to-.env-file")Pandas data processingFollowing is an example to get the number of missing values in each column of a dataframe.fromcode_genieimportPandasGeniegenie=PandasGenie(instructions=["create a new dataframe which contains the number of missing values in each column","add a column to this dataframe representing the percentage of total points which are missing","sort dataframe in descending order of number of missing items","filter out columns which have no missing values"])df_missing=genie(df)
Package: codegenlib
code-gen-librarycode-gen-library for Pythoncode-gen-lib pip installpipinstallcodegenlibcode-gen-lib import packagefromcodegenlib.enumsimportMUSTACHEfromcodegenlib.templateStreamingimportTemplateStreamingfromcodegenlib.templateFileimportTemplateFilefromcodegenlib.templateModuleimportTemplateModuleusing examplecode_gen_lib_example.pycode-gen-lib generation from json fileconfig_json_example.py## with folderconfig_json_with_template_folder_example.pycode-gen-lib generation programming exampleYou should add your module containing your folder pathname to the 'modules' path. You can add mustache files and template folder/files in your module pathfromcodegenlib.enumsimportMUSTACHEfromcodegenlib.templateStreamingimportTemplateStreamingfromcodegenlib.templateFileimportTemplateFilefromcodegenlib.templateModuleimportTemplateModulefileName="test.swift"testManagerClassTF=TemplateFile(name="manager_class_mustache",dict={"service_name":"OneframeMobile","request_func":MUSTACHE.PARENT},output_file="Manager.swift")testGetRequestFuncTF=TemplateFile(name="request_get_func_mustache",dict={"result_model_name":"String","function_name":"getTest","query_path":'"api/getTest?name=query"',"func_param":"query:String, "},output_file=None,is_child_template=True,parent_mustache="request_func")testPostRequestFuncTF=TemplateFile(name="request_post_func_mustache",dict={"result_model_name":"UserModel","function_name":"login","query_path":'"api/login"',"func_param":""},output_file=None,is_child_template=True,parent_mustache="request_func")testManagerClassTF.childTemplateFiles.append(testGetRequestFuncTF)testManagerClassTF.childTemplateFiles.append(testPostRequestFuncTF)testModule=TemplateModule(name="networking-swagger-swift",templates_files=[testManagerClassTF])tStreaming=TemplateStreaming(templateModule=testModule)tStreaming.execute()code-gen-lib generation programming example with your json filethis is written module code by json{"module":{"name":"oneframe-ios-api-manager","templateFolders":[{"source":"modules/oneframe-ios-api-manager/models","outputPath":"models","isOnline":false}],"templateFiles":[{"name":"manager_class_mustache","outputFile":"CanikServiceManager.swift","isChildTemplate":false},{"name":"learning_class_mustache","outputFile":"OneFrameLearning.swift","isChildTemplate":false}]}}importosimportsysfromcodegenlib.parserimportParser# Own modulesfromcodegenlib.templateStreamingimportTemplateStreamingpathname=os.path.dirname(sys.argv[0])# current pathjson_file_name="sample_config_with_template_folder.json"json_file_path=pathname+"/"+json_file_namesampleJsonModule=Parser.jsonToTemplateModule(json_file=json_file_path)sampleJsonModule.outputDirectory="oneframe-api-ios"sampleJsonModule.isAppendOutputPath=Trueprint(sampleJsonModule.getOutputDirectoryPath())tStreaming=TemplateStreaming(template_module=sampleJsonModule,enable_log=False,)tStreaming.execute()Can be Contribution, join us!
Package: codegenloader
CodeGenLoader is a Python import hook that transparently runs a code
generator at import time, allowing the use of generated code without
a separate compilation step.  The package includes an extensible base
class as well as implementations for the Protocol Buffer and
Thrift code generators.Installationpip install codegenloaderPrerequisitesCodeGenLoader runs on Python 2 (2.5+) and 3, including pypy and
jython.  The base class does not have any external dependencies, but
to use the Thrift or Protocol Buffer subclasses you will need the
thrift or protobuf packages installed. Note that protobuf 3.0.0
(currently in alpha) is required to use protobuf on Python 3.ExampleAdd the following two lines tomypackage/proto/__init__.py:import codegenloader.protobuf
__path__ = codegenloader.protobuf.make_path(__name__, ".")Now, assumingfoo.protoexists in inmypackage/proto/, you can do:from mypackage.proto.foo_pb2 import FooMore infoThe source code is hosted athttps://github.com/bdarnell/codegenloaderDetailed documentation can be found athttp://codegenloader.readthedocs.org
Package: codegen-metrics
Metrics for Code GenerationA library for runningInstallationTo start using the library, install it via pip or use your favorite package manager:pip install codegen-metricsUsageTo start using the library, import a metric and pass to it the reference code and the generated one.Please, notice!You should call it asmetric(reference_code, generated_code), not the other way around!fromcodegen_metricsimportbleu,chrf,codebleu,meteor,rougel,rubymetrics=(bleu,chrf,codebleu,meteor,rougel,ruby)generated_code="def hello():\n\tprint('Hello, world!')"reference_code="def bye(name: str):\n\tprint(f'bye,{name}!')"formetricinmetrics:print(metric(reference_code,generated_code))RemarksComputation of RUBY involves comparison of graphs and takes a lot of time.On the initial run, the library will setuptree-sitterandnltkwhich may take some time.
Package: codegenpt
CodeGenPTAutogenerate files or entire projects using ChatGPT API.Installationpip install codegenptUsageCodeGenPT looks for.codegenptfiles and generate files using its instructions.Generating individual filesExample:hello_world.py.codegenptCreate a hello world programThen:$codegenpthelloworld.py.codegenpt
⏳Generatingfile:helloworld.py
🍺Filegenerated:helloworld.py
🍻SuccessWill generate a file namedhelloworld.py:print("hello world");The actual content of the file will be generated by ChatGPT, so it will vary at each run. You can usecodegenpt -R .to recursively look for all.codegenptfiles and generate them.Generate entire directories or projectsYou can create entire directories or projects using a.dir.codegenptfile.
Example:tictactoe.dir.codegenptCreate a tic-tac-toe game using html, js and css.Then:$codegenpttic-tac-toe.dir.codegenpt
⏳Generatingdirectory:tic-tac-toe
🍺Filegenerated:tic-tac-toe/style.css
🍺Filegenerated:tic-tac-toe/index.html
🍺Filegenerated:tic-tac-toe/game.js
🍻SuccessWill create a folder called tic-tac-toe and generate all needed files.SetupCodeGenPT expects an environment variable calledOPEN_API_KEY.Get anOpen AI API KeyAdd the key to yourOPEN_API_KEYenvironment variable:If you usebash:echo'export OPENAI_API_KEY={your api key}'>>~/.bash_profile&&source~/.bash_profileIf yu usezsh:echo'export OPENAI_API_KEY={your api key}'>>~/.zshenv&&source~/.zshenvCommandsCommands are special instructions you can use to instruct the generation process.All codegenpt commands are placed in a single line in the format:@command_name args...@includeIncludes one or more files on the context.
Included files can be referenced using@filename.extin the generation instructionsExample:names.txt:Diego
Alberto
Danielrandom_name.js.codegenpt:@include assets/names.txt

Read @names.txt and write a function that returns one of the namesrandom_name.js:functiongetRandomName(){constnames=['Diego','Alberto','Daniel'];constrandomIndex=Math.floor(Math.random()*names.length);returnnames[randomIndex];}
Package: codegpt
Codegpt0.3A tool for using GPT just a little quicker. A nearly truly automated footgun. Learn how to revert with git before trying please.Posting about progress here:Getting Startedpip install codegpt --upgradeAnd set your openapi API key as an environment variable like they recommend:In their docs hereWindows users can also usesetxlike:$ setx OPENAI_SECRET_KEY=<YOUR_API_KEY>from an admin console.Your first (safe) commandOne cool thing is generating documentation. GPT-3 has a token limit of 4000 for completions, so larger files will be chunked up.codegptdocs<paths>And it'll generate docs, one per file. This is great when you're coming into a codebase you've never seen before.Unsafe CommandsEverything else can modify files. Have someone hold your beer and try some of these (after you check it into git):Usage
To try Codegpt, you can run the following command:codegptdo<instructions(quoted)>-freadme.mdIt can do basically anything. Try handing in some files for context and telling it to generate something new - SQL queries, new features, documentation, whatever.Or use the quick command to do some neat stuff, like:Generate docscodegptquickdocs<filenames>Change variable names to be more readablecodegptquickvarnames<filenames>Add comments to your code automaticallycodegptquickcomment<filenames>Check for bugs (iffy, but worth a shot)codegptquickbugs<filenames>Check for vulnerabilities (even more iffy, but worth a shot)codegptquickvulns<filenames>Try to make code less miserablecodegptquickugh<filenames>Keep in mind that using GPT-3 for code generation is paid, with a cost of 2 cents per 1,000 tokens.Just like with a Jr Dev, it's best to break up your tasks into smaller pieces to improve the results.
Package: codegpt-sdk
CODEGPT Python PackageThis package provides you with an easy way to interact with the CODEGPT API in your Python applications.InstallTo install the package, simply run the following command:pipinstallcodegpt-sdkUsegeBelow is a sample code demonstrating how to use the CODEGPT package in your Python application:# Import the packageimportasynciofromcodegpt.agentimportAgentdefmain():# Replace with your actual API key and URL IDapi_key="your_api_key_here"agent_id="your_agent_id_here"# Initialize the CODEGPT classagent_instance=Agent(api_key,agent_id)# Optional: update API key or URL ID if neededagent_instance.set_api_key("new_api_key")agent_instance.set_agent_id("new_agent_id")# Create the promptprompt="tell me short story about blue turtle"# Make a completion requestresponse=asyncio.run(agent_instance.completion(prompt,stream=False))# Handle the response as neededprint(response)if__name__=="__main__":main()
Package: codegrade
CodeGrade APIThis library makes it easier to use the CodeGrade API. Its API allows you to
automate your usage of CodeGrade. We are currently still busy documenting the
entire API, but everything that is possible in the UI of CodeGrade is also
possible through the API.InstallationYou can install the library throughpypi, simply runpython3 -m pip install codegrade. If you want to get a dev version with support
for the latest features, simply emailsupport@codegrade.comand we'll provide you with a dev version.UsageFirst, create a client:importcodegrade# Don't store your password in your code!withcodegrade.login(username='my-username',password=os.getenv('CG_PASSWORD'),tenant='My University',)asclient:pass# Or supply information interactively.withcodegrade.login_from_cli()asclient:passNow call your endpoint and use your models:fromcodegrade.modelsimportPatchCourseDatacourses=client.course.get_all()forcourseincourses:client.course.patch(PatchCourseData(name=course.name+' (NEW)'),course_id=course.id,)# Or, simply use dictionaries.forcourseincourses:client.course.patch({"name":course.name+' (NEW)'},course_id=course.id,)For the complete documentation go tohttps://python.api.codegrade.com.Backwards compatibilityCodeGrade is constantly upgrading its API, but we try to minimize backwards
incompatible changes. We'll announce every backwards incompatible change in thechangelog. A new version of the API
client is released with every release of CodeGrade, which is approximately every
month. To upgrade simply runpip install --upgrade codegrade.Supported python versionsWe support python 3.6 and above,pypyis currently not tested but should work
just fine.LicenseThe library is licensed under AGPL-3.0-only or BSD-3-Clause-Clear.
Package: code-grader
code-graderGenerate a PDF of graded source files as a feedback for studentsInstallationPlease ensure thatlatexmkorpdflatexis in$PATH!We use themintedand thegeometryLaTeX packageInstall this packagepip3installcode-graderOr from this repo:pip3install-e.Usagecode-graderSignal.javaLinearFilter.javawhereSignal.javaLinearFilter.javaare Java source code files somewhere in the directory structure of current
directory.Usually, you want to grade more than one student:# Will generate one PDF for each subdir of current working directorycode-graderSignal.javaLinearFilter.java--batch-gradeMore options:code-grader-hMagic CommentsComment your code with/// <-Hint for the students// [task blub: X/Y points]Grading for a subtask
Package: codegraph
Tool that create a graph of code to show dependencies between code entities (methods, classes and etc).
CodeGraph does not execute code, it is based only on lex and syntax parse, so it not need to install
all your code dependencies.Usage:pip install codegraphcg /path/to/your_python_code
# path must be absoluteyour_python_code - module with your python codeFor example, if I put codegraph in my user home directory path will be:cg /Users/myuser/codegraph/codegraphPass ‘-o’ flag if you want only print dependencies in console and don’t want graph visualisationcg /path/to/your_python_code -oIf you want to change view and play with graph output - you can check ‘vizualyzer.py’
and play with matplotlib and networkX settings.In default view - red line show dependencies between entities in different modules. Green - entities in module.TODO:Create normal readmeAdd testsAdd possibility to work with any code based (not depend on Python language only)Work on visual part of Graph (now it is not very user friendly)Add support to variables (names) as entitiesContributing:Open PR with improvements that you want to addIf you have any questions - write mexnuinside@gmail.com
Package: codegrapher
Code that graphs codeUses the pythonASTto parse Python source code and build a call graph.OutputAn example of the current output of the parser parsing itself.InstallationpipinstallcodegrapherTo generate graphs,graphvizmust be installed.UsageAt the command lineTo parse a file and output results to the console:codegrapherpath/to/file.py--printedTo parse a file and output results to a file:codegrapherpath/to/file.py--outputoutput_file_name--output-typepngTo analyze a directory of files, along with all files it contains:codegrapher-rpath/to/directory--outputmultiple_file_analysisAnd if you have a list of functions that aren’t useful in your graph, add it to a.cg_ignorefile:# cg_ignore file
# all lines beginning with '#' are ignored

# every function calls this, so it's not helpful in my graph:
log_error

# I don't want to see this in my graph:
parse
lowerThen add the–ignoreflag to your command. Using the flag–remove-builtinsprovides the same functionality
for ignoring items found in__builtins__.As a Python moduleTo easily parse code in Python :fromcodegrapher.parserimportFileObjectfile_object=FileObject('path/to/file.py')file_object.visit()And then to add that code to a graph and render it (using graphviz):fromcodegrapher.graphimportFunctionGraphergraph=FunctionGrapher()graph.add_file_to_graph(file_object)graph.name='name.gv'graph.format='png'graph.render()Which will produce your code as a png file,name.gv.png, along with adot filename.gvMore documentation for the Python module can be found atRead the Docs.
Package: codeguru-profiler-agent
Amazon CodeGuru Profiler Python AgentFor more details, check the documentation:https://docs.aws.amazon.com/codeguru/latest/profiler-ug/what-is-codeguru-profiler.htmlHow to use itThis package is being released to PyPI ascodeguru-profiler-agent, so use it as any Python package from PyPI.For a demo application that uses this agent, check ourdemo application.How to contributeCheck the GitHub repository ataws/amazon-codeguru-profiler-python-agent.SeeCONTRIBUTINGfor details.How to releaseSeeDEVELOPMENTfor more information.SecuritySeeCONTRIBUTINGfor more information.LicenseThis project is licensed under the Apache-2.0 License. SeeLICENSEfor details.
Package: codehash
CodehashInstallingInstall and update usingPip.pip install -U codehashA simple examplefromcodehashimporthash_functiondct={'a':1}deff(x):return1+dct["param"]h1=hash_function(f)deff(x):"""Docstring."""return1+dct["param"]# commenth2=hash_function(f)dct={'a':2}deff(x):return1+dct["param"]h3=hash_function(f)asserth1==h2asserth1!=h3
Package: codehelp
version number: 0.0.3
author: Tan Kok HuaOverviewModule that help to shorten time and aid in writing codeInstallation / UsageTo install use pip:$ pip install codehelpOr clone the repo:$ git clonehttps://github.com/spidezad/codehelp.git$ python setup.py installContributingTBDExampleTBD
Package: codehint
CodeHintis a package for describing a function within the python console during runtime.
It works in the same way as an advanced IDE does when it displays the hint for function, but pretty-printing to
console rather than to a window.ExampleIf we have the following function defined somewhere in our code:>>>defhello(a,b:int,c)->int:..."""
...     Hello, this is an explanation
...     of what this is going to do
...     :param a: foo
...     :param b: bar example
...     :param c:
...     :return: True if good, False otherwise.
...     """...x=a+b*2*c...returnxIt can be described later on withCodeHint:>>>fromcodehintimporthint>>>hint(hello)The result is------------------------defhello(a,b:int,c)->int:Hello,thisisanexplanationofwhatthisisgoingtodo===Parameters:3======[0]a(typeAny)->foo[1]b(typeint)->barexample[2]c(typeAny)->========================Result(typeint)->Trueifgood,Falseotherwise.CodeHintcurrently can only be used to describe the signature of functions or methods.InstallationIt is only supportedPython 3.4.1onwards:sudopip3installcodehintLICENSEIt is released under theMIT license.
Package: code-image-to-text
Code Image to Text ConverterConvert code image into text.For example, if you want to extract code from the image namedimages/carbon.png.Type:python-mimage_converterimages/carbon.png.pyThis will convert the image to text like below and save the code to the file namedcarbon.py.classDataLoader:def__init__(self,data_dir:str):self.data_dir=data_dirprint("Instance is created")def__call__(self):print("Instance is called")data_loader=DataLoader('my_data_dir')data_loader()InstallationIntall TesseractLinuxsudoapt-getupdate
sudoapt-getinstalltesseract-ocr
sudoapt-getinstalllibtesseract-devWindows
Install fromhereInstall code-image-to-textpipinstallcode-image-to-text