Saravanan666/pypi-org huggingface dataset:
Package: comment-parser
Comment ParserPython module used to extract comments from source code files of various types.InstallationPrerequisiteslibmagicLinux/Unixsudopip3installcomment_parserOSX and WindowsAdditionally, complete the special installation requirements forpython-magic.UsageTo use, simply run:>>>fromcomment_parserimportcomment_parser>>># Returns a list of comment_parser.parsers.common.Comments>>>comment_parser.extract_comments('/path/to/source_file')>>># Or>>>comment_parser.extract_comments_from_str('...')extract_comments signaturesdefextract_comments(filename,mime=None):"""Extracts and returns the comments from the given source file.Args:filename: String name of the file to extract comments from.mime: Optional MIME type for file (str). Note some MIME types accepteddon't comply with RFC2045. If not given, an attempt to deduce theMIME type will occur.Returns:Python list of parsers.common.Comment in the order that they appear inthe source file.Raises:UnsupportedError: If filename is of an unsupported MIME type."""passdefextract_comments_from_str(code,mime=None):"""Extracts and returns comments from the given source string.Args:code: String containing code to extract comments from.mime: Optional MIME type for code (str). Note some MIME types accepteddon't comply with RFC2045. If not given, an attempt to deduce theMIME type will occur.Returns:Python list of parsers.common.Comment in the order that they appear inthe source code.Raises:UnsupportedError: If code is of an unsupported MIME type."""passComments InterfaceclassComment(object):"""Represents comments found in source files."""deftext(self):"""Returns the comment's text.Returns:String"""passdefline_number(self):"""Returns the line number the comment was found on.Returns:Int"""passdefis_multiline(self):"""Returns whether this comment was a multiline comment.Returns:True if comment was a multiline comment, False if not."""passdef__str__(self):passdef__eq__(self,other):passDevelopmentRunning locallyStart python3 in the base of repository.fromcomment_parserimportcomment_parsercomment_parser.extract_comments('foo.c',mime='text/x-c')Running testspython3setup.pytestRunning pylintpylintcomment_parserRunning formatteryapf-rip--style=yapf.Deploying to PyPipython3setup.pysdist
twineuploaddist/*Supported Programming LanguagesLanguageMime StringCtext/x-cC++/C#text/x-c++Gotext/x-goHTMLtext/htmlJavatext/x-java-sourceJavascriptapplication/javascriptPythontext/x-pythonPythontext/x-script.pythonRubytext/x-rubyShelltext/x-shellscriptXMLtext/xmlAnd more to come!Check comment_parser.py for corresponding MIME types.
Package: comments
commentsA simple Python wrapper for thehttps://comments.botAPI.Basic usageimportcommentsclient=comments.Client("YOUR_API_KEY_HERE",owner_id=YOUR_USER_ID_HERE)post=client.createPost(type="text",text="Hello world")print(post.post_id)print(post.link)You will get something like this:xxxxxxxx
https://comments.bot/thread/xxxxxxxxcreatePost() arguments:owner_id:required if not passed on Client.type:must betextorphoto.textis used by default if not specified.text:required iftypeequals totext. It must be a string betwen 0-4056 characters.photo_url:required iftypeequals tophoto. It must be a string containing a link to the image.caption:Caption for the image. Only valid forphototype.parse_mode:Parse mode for the text/caption. It must bemarkdownorhtml.administrators:A string with user_ids (numbers) separated by comma. Example:123456789,987654321,012345678.disable_notifications:Pass True if you don't want to receive notifications about new comments for your post.
Package: comments.bot
Comments.botA simple API wrapper to interact withcomments.botapi.InstallationThe latest version of comments.bot is available viapip:pipinstall--upgradecomments.botAlso, you can download the source code and install using:poetryinstallNote:You need to havepoetryinstalled on your systemUsageThe library can be used in both Sync and Async!
For both there are 2 client which can be imported from comments_bot - SyncClient, AsyncClient.fromcomments_botimportSyncClient,AsyncClientfromasyncioimportrunasyncClient=AsyncClient(api_key="some api key",owner_id=12345678)# Async ClientsyncClient=SyncClient(api_key="some api key",owner_id=12345678)# Sync Client# Both of the clients have same function - createPost, editPost, deletePostpost_text_id,link_text=syncClient.createPost(text="hey")# Post a text messagepost_photo_id,link_photo=syncClient.createPost(type="photo",photo_url="some url",caption="some text for caption")# Post a photostatus,post_text_id=syncClient.editPost(post_id=post_text_id,text="some other message")status=syncClient.deletePost(post_id=post_id)# Deletes the post from comments.botYou can use the below methods for both SyncClient and AsyncClient.Methods Available:createPost() arguments:owner_id:required if not passed on Client.type:must betextorphoto.textis used by default if not specified.text:required iftypeequals totext. It must be a string betwen 0-4056 characters.photo_url:required iftypeequals tophoto. It must be a string containing a link to the image.caption:Caption for the image. Only valid forphototype.parse_mode:Parse mode for the text/caption. It must bemarkdownorhtml.administrators:A string with user_ids (numbers) separated by comma. Example:123456789,987654321,012345678.disable_notifications:Pass True if you don't want to receive notifications about new comments for your post.editPost() arguments:type:must betextorphoto.textis used by default if not specified.text:required iftypeequals totext. It must be a string betwen 0-4056 characters.photo_url:required iftypeequals tophoto. It must be a string containing a link to the image.caption:Caption for the image. Only valid forphototype.parse_mode:Parse mode for the text/caption. It must bemarkdownorhtml.deletePost() arguments:post_id:Pass the post id to be deletedContribuitingWanna help and improve this project?Make sure to follow these before opening a PR:Make sure your PR passes the test and is formatted according to pre-commit.Make sure the package is working without any issues!LicenseThis project is licensed under the MIT License - see theLICENSEfile for details
Package: comment-spell-check
CommentSpellCheckThe CommentSpellCheck (CSC) package provides a script that automatically
spell checks the comments of a code base.  It was originally developed to
be run on the SimpleITK and ITK code bases.Here is how it is typically run:python comment_spell_check.py --exclude Ancillary $SIMPLEITK_SOURCE_DIR/CodeThis command will recursively find all the '.h' files in a directory,
extract the C/C++ comments from the code, and run a spell checker on them.
The'--exclude'flag tells the script to ignore any file that has
'Ancillary' in its full path name.  This flag will accept any
regular expression.In addition to pyenchant's English dictionary, we use the words inadditional_dictionary.txt.  These words are proper names and
technical terms harvest by hand from the SimpleITK and ITK code bases.If a word is not found in the dictionaries, we try two additional checks.If the word starts with some known prefix, the prefix is removed
...and the remaining word is checked against the dictionary.  The prefixes
...used by default are'sitk','itk', and'vtk'.  Additional
...prefixes can be specified with the'--prefix'command line argument.We attempt to split the word by capitalization and check each
...sub-word against the dictionary.  This method is an attempt to detect
...camel-case words such as 'GetArrayFromImage', which would get split into
...'Get', 'Array', 'From', and 'Image'.  Camel-case words are very commonly
...used for code elements.The script can also process other file types.  With the'--suffix'option, the following file types are available: Python (.py), C/C++
(.c/.cxx), Text (.txt), reStructuredText(.rst), Markdown (.md), Ruby (.ruby),
and Java (.java).  Note that reStructuredText files are treated as standard
text.  Consequentially, all markup keywords that are not actual words will
need to be added to the additional/exception dictionary.Dictionary notesBy default, on Linux and Mac systems, pyenchant usesGNU aspellas the underlying dictionary.  The spell checking is case sensitive.  While
aspell allows arbitrary characters in a dictionary word, CSC may split up
a word by non-alphanumeric characters.  This split can occur if the word
itself is not found in the dictionary.If a dictionary word has non-alphanumeric characters, CSC prints a warning.
Package: commercetools
This is an unofficial Python SDK for the Commercetools platform. It only
supports Python 3.6+ and uses type annotation for an improved development
experience.The API is generated using the commercetools api RAML file and uses
marshmallow for the serialization and deserialization.Installationpip install commercetoolsExamplefromcommercetools.platformimportClientclient=Client(client_id="<your-client-id>",client_secret="<your-client-secret>",scope=["<scopes>"],url="https://api.europe-west1.gcp.commercetools.com",token_url="https://auth.europe-west1.gcp.commercetools.com",)product=(client.with_project_key("<your-project-key>").products().with_id("00633d11-c5bb-434e-b132-73f7e130b4e3").get())print(product)The client can also be configured by setting the following environment
variables:exportCTP_CLIENT_SECRET="<client secret>"exportCTP_CLIENT_ID="<client id>"exportCTP_AUTH_URL="https://api.europe-west1.gcp.commercetools.com"exportCTP_API_URL="https://auth.europe-west1.gcp.commercetools.com"exportCTP_SCOPES="<comma seperated list of scopes>"And then constructing a client without arguments:fromcommercetools.platformimportClientclient=Client()product=(client.with_project_key("<your-project-key>").products().with_id("00633d11-c5bb-434e-b132-73f7e130b4e3").get())print(product)ReleasingTo release this package first (pip) install bump2version and update the
CHANGES file. Then update the version (either major/minor/patch depending on
the change)bumpversion--tag<major,minor,patch>bumpversion is naive because it string replaces, so do a sanity check it
didn’t accidentally update a Pypi dependency. If not, push the code:gitpush--follow-tagsWe use GitHub actions so make sure the build succeeds and then go to the tags
tab (https://github.com/labd/commercetools-python-sdk/tags).Click the dots to trigger a release action. Copy the changelog items in the
release description and enter the release version. This will upload the
release to PyPi.
Package: commercetools-ratdev
This is an unofficial Python SDK for the Commercetools platform. It only
supports Python 3.6+ and uses type annotation for an improved development
experience.The API is mostly generated using the commercetools api RAML file and uses the
attr library for the dataobjects and marshmallow for the serialization and
deserialization steps.Installationpip install commercetoolsExamplefromcommercetoolsimportClientclient=Client(project_key="<your-project-key>",client_id="<your-client-id>",client_secret="<your-client-secret>",scope=["<scopes>"],url="https://api.sphere.io",token_url="https://auth.sphere.io/oauth/token",)product=client.products.get_by_id("00633d11-c5bb-434e-b132-73f7e130b4e3")print(product)The client can also be configured by setting the following environment
variables:exportCTP_PROJECT_KEY="<project key>"exportCTP_CLIENT_SECRET="<client secret>"exportCTP_CLIENT_ID="<client id>"exportCTP_AUTH_URL="https://auth.sphere.io"exportCTP_API_URL="https://api.sphere.io"exportCTP_SCOPES="<comma seperated list of scopes>"And then constructing a client without arguments:fromcommercetoolsimportClientclient=Client()product=client.products.get_by_id("00633d11-c5bb-434e-b132-73f7e130b4e3")print(product)
Package: commie
commiePython package forextracting commentsfrom source code.Multiple programming and markup languages are
supported:see list.Install$pip3installcommieFind comments in a filefrompathlibimportPathimportcommieforcommentincommie.iter_comments(Path("/path/to/source.cpp")):# something like "/* sample */"print("Comment code:",comment.code)print("Comment code location:",comment.code_span.start,comment.code_span.end)# something like " sample "print("Comment inner text:",comment.text)print("Comment text location:",comment.text_span.start,comment.text_span.end)Find comments in a stringMethodWorks forcommie.iter_comments_cC, C++, C#, Java, Objective-C, JavaScript, Dart, TypeScriptcommie.iter_comments_goGocommie.iter_comments_rubyRubycommie.iter_comments_pythonPythoncommie.iter_comments_shellBash, Shcommie.iter_comments_htmlHTML, XML, SGMLcommie.iter_comments_cssCSScommie.iter_comments_sassSASSimportcommiesource_code_in_golang:str=...forcommentincommie.iter_comments_go(source_code_in_golang):# ... process comment ...passFind comments in a string with a known filenameMethodcommie.iter_commentswill try to guess the file format from the provided filename.frompathlibimportPathimportcommiefilename:str="/path/to/mycode.go"source_code:str=Path(filename).read_text()forcommentincommie.iter_comments(source_code,filename=filename):# ... process comment ...passGroup single line commentsWhen single-line comments are adjacent, it makes sense to consider them together:// Group A: A short comment// Group B: It consists of three// single-line comments with// no empty lines between them// Group C: This paragraph loosely// stretched into two linesThe comments from the example above can be combined intothree groupsas follows:fromcommieimportiter_comments,group_singleline_commentsforgroupingroup_singleline_comments(iter_comments(...)):# ... each group is a list of Comment objects ...passMulti-line comments will also be returned. They will not be grouped with their neighbors.HistoryThis project was forked fromcomment_parserin 2021. Motivation:comment_parsercommieReturns only a line numberReturns positions where the comment starts and ends. Just like regular string searchReturns only the text of a commentRespects markup as well, making it possible to remove or replace the entire commentDepends onpython-magicthat requires an optional installation of binariesPure Python. Easy to install withpip
Package: commis
Commis is a library to create command line utilities like git or django-admin where there is a single command that implements many subcommands. Internally, Commis uses the argparse module to create subparsers and parse command line options. However, much like the Django management utility, it exposes an API that allows you to write command classes and create very simple console programs.For more, please see the full documentation at:http://commis.readthedocs.org/
Package: commit5
commit5Automatically generate commit messages locally using T5. Currently using "SEBIS/code_trans_t5_small_commit_generation_transfer_learning_finetune", as it seems like the best quality for performance ratio (best T5-base model). Based on work ofhttps://github.com/agemagician/CodeTrans, which uses data fromhttps://github.com/epochx/commitgen.Installation and UsageEnsure you have docker installed. Then run:pipinstallcommit5
commit5download# Pulls the docker imagecommit5start# Starts the docker containerWait around 10 seconds for the image to spin up to load the model into memory. Then runcommit5testThen, to automatically commit:commit5commitAlternatively, to only generate messages, runcommit5generate<diff_string>Where diff_string is the string of the diff.OptimizationsFastT5 reduced the file sizes from 900mb (torch file) to a total of only 200mb (3 ONNX models) and the memory footprint to only 90mb. Further, the execution speed dropped from 1.3s to 0.5s.diff --git a/grunt/tasks/release.js b/grunt/tasks/release.jsindex efbb2e7..d377ee4 100644--- a/grunt/tasks/release.js+++ b/grunt/tasks/release.js@@ -7,7 +7,7 @@ var grunt = require('grunt');var BOWER_PATH = '../react-bower/';var BOWER_GLOB = [BOWER_PATH + '*'];-var BOWER_FILES = ['React.js', 'React.min.js', 'JSXTransformer.js'];+var BOWER_FILES = ['react.js', 'react.min.js', 'JSXTransformer.js'];var GH_PAGES_PATH = '../react-gh-pages/';var GH_PAGES_GLOB = [GH_PAGES_PATH + '*'];VisionI think in general there's a huge space for locally running LM-based devtools. There's generally huge privacy concerns in corporations around productivity tools for dev which is the problem around adoptivity of tools like Copilot/Codeium/Tabnine in companies, and I think powerful LM's can be built smaller while laptops are becoming beefier. There's also an assortment of optimizations (distillation + ONNX + quantization + llama.cpp) for running LLM's on lower-power machines.ArchiveONNX Runtime improves performance from 1.3s to 670ms per iteration, but the resulting model is bigger (1.7gb of three files vs 800mb in original). Model can be found athttps://huggingface.co/kevinlu1248/ct-base-commits-onnx/. Tests were conducted on the following example.TODOFigure out how to load in 16-bit or 8-bit properlyTurn into a Git toolCleanup codebaseUpload to pypaMigrate to CodeTrans-smallAdd a grammar checkerUse CodeT5+
Package: commit-checker
commit-checkerThis is a quality tool with the goal to automate some of the reviewing work of pull requests in Bitbucket (or any other environment)Free software: Apache Software License 2.0Documentation:https://commit-checker.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand thetomtom-international/cookiecutter-pythonproject template.Changelog0.0.1-dev (2019-04-01)First release on PyPI.
Package: commitcleaner
CommitCleanerCommitCleaner is a tool designed to neatly reset the commit history of your Git repository while keeping the current state of the code intact. This utility allows you to maintain a clean repository, starting afresh without the clutter of unnecessary history.FeaturesRemoves Git commit historyRetains the current state of the codeCreates a new initial commitInstallationCommitCleaner is written in Python and can be easily installed via pip:pipinstallcommitcleanerUsageOnce installed, you can execute thecommitcleanercommand in your command line within the directory of your Git repository to reset its commit history:cd{yourproject}commitcleanerThis command performs the following actions:Creates an orphan branch namedlatest_branch.Adds all files to the staging area.Creates a new commit with the message "Initial commit".Deletes the existingmainbranch.Renames the current branch tomain.Force pushes the changes to the remote repository.CautionIt is advisable to backup important data before using this tool, as the process of removing commit history is irreversible.Force pushing (git push -f) to a remote repository can cause synchronization issues with other collaborators. Discuss with your team before using.AcknowledgmentsThis tool was inspired by a Stack Overflow answer, which provides a method for removing Git commit history while keeping the code in its current state. You can find the original solutionhere.CreditsThis project was generated with the assistance of ChatGPT-4, an advanced language model developed by OpenAI. The tool's concept, code snippets, and documentation were crafted through interactive sessions with the AI, showcasing the potential of AI-assisted software development.ContributingIf you would like to contribute to thecommitcleanerproject, please feel free to submit an issue or a pull request on GitHub. All contributions are welcome!LicenseThis project is distributed under theMIT License.
Package: commitcli
Git Commmit CliThis project provides a cli to make git commits with a minimizedodoo formatfrom a text wizard.Checkit out onpypi.Is a wrapper of thegit commit -mcommand writed with 💟 on Python.This was tested on a raspbian and a fedora OS with the nano, nvim and vim editor.supported formats:short odooconventional commitssemantic git commitsfree (this is like use nativegit commitcommand)FeaturesCommitcli configuration file per projectYou can add a.commitclircfile in your project directory.you can copy the global.commitclircfile to your project directory and edit it to use a diferent format.cp~/.commitclirc.commitclircInstallation1 - Install the packagenote : use sudo if the local (user) python bin dir is not in the pathsudopipinstallcommitcliexample content of the.commitclircfile:#Format for every commit#supported formats free, odoo, sgc(semantic git commits) and cc (conventional commits)format=odoo#Option to sign the commits o every commit, must be True or Falsesigngpg=Falsechange this to use cc on your project:#Format for every commit#supported formats free, odoo, sgc(semantic git commits) and cc (conventional commits)format=cc#Option to sign the commits o every commit, must be True or Falsesigngpg=Falsesave this file and add to your git repository and every comand will use cc format on this project.2 - EnjoyAdd files to commitgitadd.Use the toolcommitcliExampleOdoo (default)ConfigurationThis utility creates a file into the users home directory~/.commitclircin this file you will find some customizable options. the most important is the format option this option accepts this formats:odooccfreeNext Updatesonly make a echo of a formatcli inline option to specify format (oddo, sgc, etc)module list to chose for context in cc or something like thistype(context)quick templatesclean upsmarterstore module list and provide a list of modules to choose from and the last by defaultcreate branchesuse format /<type "ej fix">/Formatsconventional commitsCCsemantic git commitSGCodoo tagsOdooDevelopmentHelpusing without install from the sourcepython -m commitcliReferenceshttps://magmax.org/python-inquirer/https://python-packaging.readthedocs.io/en/latest/command-line-scripts.htmlhttps://setuptools.readthedocs.io/en/latest/userguide/entry_point.htmlhttps://medium.com/better-programming/python-click-building-your-first-command-line-interface-application-6947d5319ef7
Package: commit-entropy
Commit Entropy is a tool that can be used to calculate the entropy of
changes in a source code repository. Entropy for code changes is a
measure of how specific each commit was in relation to the entire code
base. Very specific commits only affect a small set of files, and thus
have a low entropy. Commits that touch a large number of files are much
less specific and have a higher entropy as a result.The term Entropy in this context is a simplified application ofShannon
Entropyto commits in a source repository. It’s simplified since we only look at
the number of files changed each commit, with each file having an equal
probability.Read more about entropy on ourblog.InstallationCommit Entropy currently supportsPython
3.x. It can be installed usingpip.pip install commit-entropyThis will install thecommit-entropyexecutable on your path.If you don’t have pip, you can install it manually by cloning the code
and running the install script:git clone git@github.com:GripQA/commit-entropy.git
cd commit-entropy
python setup.py installUsageCurrently we support a single operation: exporting a csv file with the
average entropy per day and a 30-day rolling average. From within a git
repo:commit-entropy csvThis will output aentropy.csvfile in the current directory with
the average entropy values.You can ignore a list of paths by using the--ignoreoption:commit-entropy csv --ignore=vendor/*,*.logSupportIf you have any questions, problems, or suggestions, please submit anissueor contact us atsupport@grip.qa.
Package: commitgpt
commitgptcommitgpt assists developers in generating high-quality commit messages for their version control systems, such as git.FeaturesGenerate commit messages from OpenAI's GPT-3 API based on the changes in the diffConfigurable commit message guidelinesConfigurable OpenAI GPT-3 agent rolePrerequisitesAn OpenAI API keyPython 3.6 or higherPipGitInstallationpipinstallcommitgptUsagecommitgptsetupExampleMake a change to a file, then rungit diffto see the changes. Then, runcommitgptto generate a commit message.commitgptContributingSeeCONTRIBUTING.mdLicenseGNU GENERAL PUBLIC LICENSE