Saravanan666/pypi-org huggingface dataset:
Package: codestare-proto-plus
Plugin to generate proto-plus classes with protoc compiler.Available plugin parameters [flags]:readable_imports  — import in the style “from … import …”relative_imports  — use relative imports instead of absolutegenerate_inits    — generate __init__.py files, always uses readable_imports to avoid circular importsquiet             — don’t print compiler outputAvailable plugin parameters [keywords]:save_request — saves input as .json and binary file with specified namepackage — use this string as name for the __package__ module attributesExample:protoc --proto-plus_out=generate_inits,relative_imports,readable_imports,package=mypackage,save_request=test_request:./output_dir schema.protoMIT License
Copyright (c) 2021, Maximilian SchmidtPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: codestructure
:building_construction: CodeStructureExtract code signatures without the code :snake:This program extracts information about the structure of Python code by analyzing the abstract syntax tree (AST) of a given Python file.
It extracts information about classes, their attributes, and functions, as well as their signatures, parameters, return types, decorators, and docstrings.
The script then print this information in a human-readable format with syntax highlighting.
It can also copy the output to the clipboard.
It is particularly useful for understanding and documenting complex codebases and writing design docs or when pasting in some code in ChatGPT.:star: Features🔎 Identifies class and function signatures without executing the code📝 Retrieves class attributes📚 Gathers function parameters and their corresponding types🔄 Determines function return types🎨 Recognizes decorators and docstrings🌟 Presents the code in an easily understandable format with Syntax Highlighting✅ Has 100% test coverage:books: Table of Contents:package: Installation:book: Usage:memo: Example:busts_in_silhouette: Contributing:page_with_curl: License:package: InstallationYou can install CodeStructure via pip:pipinstallcodestructure:book: UsageTo use CodeStructure, simply run the script with the path to the Python file you want to analyze:codestructurepath/to/your/python_file.pyThe script will output the analyzed code structure and copy it to the clipboard if thepyperclippackage is installed.Run the script with the--helpflag to see all available options:codestructure--helpWhich outputs:usage:codestructure[-h][--no-private][--no-copy][--backticks][--no-rich][--line-numbers]module_file_path

AnalyzethecodestructureofaPythonfile.

positionalarguments:module_file_pathPathtothePythonfile.

options:-h,--helpshowthishelpmessageandexit--no-privateDonotprintprivatefunctions.--no-copyDonotcopytheoutputtotheclipboard.--backticksUsebackticksforcodeblocks.--no-richDonotuserichtoprinttheoutput.--line-numbersPrintlinenumbersforthecodeblocks.:memo: ExampleGiven a Python file (tests/example.py) with the following content:classMyClass:my_attr:str_my_private_attr:intdefmy_method(self,arg1:int)->bool:"""My docstring."""x=1+2...defmy_function(arg2:float)->None:arg2=arg2+1returnarg2**2def_private_function():"""My private function."""x=1+2y=x+4returnyCodeStructure will output:codestructure--no-privatetests/example.pyclassMyClass:my_attr:strdefmy_method(self,arg1:int)->bool:"""My docstring."""defmy_function(arg2:float)->None:...:busts_in_silhouette: ContributingWe welcome contributions to CodeStructure! If you find a bug or have a feature request, please create an issue on theGitHub repository. If you would like to contribute code, please fork the repository and submit a pull request.:page_with_curl: LicenseCodeStructure is released under the Apache 2.0 License. For more information, please see theLICENSEfile.
Package: codestyle
This script checks and auto fixes codestyle for all supported languages:PHP (phpcs)Python (flake8)Javascript (jscs and jshint)CSS (csscomb)HTML (htmlcs)Installation# First install the pip, npm and pear package managers
# Example for debian
sudo apt-get install python-pip npm php-pear

# Install codestyle and dependencies
pip install codestyle
npm install -g jshint jscs-fixer csscomb htmlcs walk brace-expansion
pear install PHP_CodeSnifferUsageusage: codestyle [-h] [-I] [-i] [-c] [-s standard-dir] [-l language name]
                 [-e glob pattern [glob pattern ...]]
                 target [target ...]

Check and fix a code style

positional arguments:
  target                files for a checking

optional arguments:
  -h, --help            show this help message and exit
  -i, --fix             auto fix codestyle errors if possible
  -c, --compact         Show a compact output
  -s standard-dir, --standard standard-dir
                        A path to a coding standard directory
  -l language name, --language language name
                        force set the language for a checking
  -x glob pattern [glob pattern ...], --exclude glob pattern [glob pattern ...]
                        Exclude paths/files from checkingExample# check all supported files in directory recursive
codestyle /path/to/project/dir
# check set of files
codestyle test.js test.php test.py
# test directory with exclude rules
codestyle /path -x '*.html' './tests/excluded_dir'
# check file and try to fix errors
codestyle -i test.js
# check project with compact output (no detail errors information)
codestyle -c /path/to/project/dir
# check all project and save full report to file
codestyle /path/to/project &> report.txtDependenciesphpcsphpcbfjshint (NodeJS)jscs-fixer (NodeJS)jscs (NodeJS)flake8csscomb (NodeJS)htmlcs >= 0.1.4 (NodeJS)walk (NodeJS)brace-expansion (NodeJS)Usage from the docker containerAlso you can usethe docker containerwith all installed dependencies.
Package: codesurvey
CodeSurveyGitHub-DocumentationCodeSurvey is a framework and tool to survey code repositories for
language feature usage, library usage, and more:Survey a specific set of repositories, or randomly sample
repositories from services like GitHubBuilt-in support for analyzing Python code; extensible to support
any languageWrite simple Python functions to define the code features you want
to survey; record arbitrary details of feature occurrencesSupports parallelizization of repository downloading and analysis
across multiple processesLogging and progress tracking to monitor your survey as it runsInspect the results as Python objects, or in an sqlite databaseInstallationpip install codesurveyUsageTheCodeSurveyclass can easily be configured to run a survey, such
as to measure how often themathmodule is used in a random set of
recently updated Python repositories from GitHub:fromcodesurveyimportCodeSurveyfromcodesurvey.sourcesimportGithubSampleSourcefromcodesurvey.analyzers.pythonimportPythonAstAnalyzerfromcodesurvey.analyzers.python.featuresimportpy_module_feature_finder# Define a FeatureFinder to look for the `math` module in Python codehas_math=py_module_feature_finder('math',modules=['math'])# Configure the surveysurvey=CodeSurvey(db_filepath='math_survey.sqlite3',sources=[GithubSampleSource(language='python'),],analyzers=[PythonAstAnalyzer(feature_finders=[has_math,],),],max_workers=5,)# Run the survey on 10 repositoriessurvey.run(max_repos=10)# Report on the resultsrepo_features=survey.get_repo_features(feature_names=['math'])repo_count_with_math=sum([1forrepo_featureinrepo_featuresifrepo_feature.occurrence_count>0])print(f'{repo_count_with_math}out of{len(repo_features)}repos use math')For more Sources of repositories, seeSource
docsFor more Analyzers and FeatureFinders, seeAnalyzer
docsFor more options and methods for inspecting results, seeCodeSurveydocsFor details on directly inspecting the sqlite database of survey
results seeDatabase docsMore examples can be found inexamplesContributingInstall Poetry dependencies withmake depsDocumentation:Run local server:make docs-serveBuild docs:make docs-buildDeploy docs to GitHub Pages:make docs-githubDocstring style follows theGoogle style guideTODOAdd unit tests
Package: codeswitch
Code SwitchCodeSwitchis a NLP tool, can use for language identification, pos tagging, name entity recognition, sentiment analysis of code mixed data.Supported Code-Mixed LanguageWe usedLinCEdataset for trainingmultilingual BERTmodel using huggingfacetransformers.LinCEhas four language mixed data. We took three of itspanish-english,hindi-englishandnepali-english. Hope we will train and add other language and task too.Spanish-English(spa-eng)Hindi-English(hin-eng)Nepali-English(nep-eng)Language Codespa-engfor spanish-englishhin-engfor hindi-englishnep-engfor nepali-englishInstallationpip install codeswitchDependencypytorch >=1.6.0Training DetailsAll three(lid, ner, pos) sequence tagging model was trainend with huggingfacetoken classificationSentiment Analysis Model trained with huggingfacetext classificationYou can find every model and evaluation resultshereFeatures & Supported LanguageLanguage Identificationspanish-englishhindi-englishnepali-englishPOSspanish-englishhindi-englishNERspanish-englishhindi-englishSentiment Analysisspanish-englishLanguage Identificationfromcodeswitch.codeswitchimportLanguageIdentificationlid=LanguageIdentification('spa-eng')# for hindi-english use 'hin-eng',# for nepali-english use 'nep-eng'text=""# your code-mixed sentenceresult=lid.identify(text)print(result)POS Taggingfromcodeswitch.codeswitchimportPOSpos=POS('spa-eng')# for hindi-english use 'hin-eng'text=""# your mixed sentenceresult=pos.tag(text)print(result)NER Taggingfromcodeswitch.codeswitchimportNERner=NER('spa-eng')# for hindi-english use 'hin-eng'text=""# your mixed sentenceresult=ner.tag(text)print(result)Sentiment Analysisfromcodeswitch.codeswitchimportSentimentAnalysissa=SentimentAnalysis('spa-eng')sentence="El perro le ladraba a La Gatita .. .. lol #teamlagatita en las playas de Key Biscayne este Memorial day"result=sa.analyze(sentence)print(result)# [{'label': 'LABEL_1', 'score': 0.9587041735649109}]AcknowledgementLinCEBERThuggingface
Package: code-sync
code_synccode_syncauto-syncs your code changes in a local directory to a remote machine,
so that you can edit your code in your local editor and instantly run those change on a remote machine.Under the hood,code_syncis running anrsynccommand wheneverwatchdognotices changes to the code.Installationpip install code_syncAfter installing this package, thecode_synctool will be available from the command line.UsageRegister a projectcode_sync --register <project>This will prompt you to enter the local directory to sync,
the remote machines to sync to,
and the destination path on the remote to sync the files to.Once you register a project withcode_sync, it will remember that configuration.code_sync a registered projectcode_sync <project>This command will use the configuration you set for the project when you registered it.List all projects registered to code_synccode_sync --listRun code_sync with specific parameterscode_sync --local_dir <mylocaldir/> --remote_dir <myremotedir/> --target <ssh_remote> --port 2222\nEdit or delete a registered projectcode_sync --edit <project>
code_sync --delete <project>NotesStartingIn order to runcode_sync, you must have an ssh connection open in another window.
Once you've entered your password there,code_syncuses that connection.The destination dir must exist already, but need not be empty.StoppingYou can safely quitcode_syncwith control-c.Aboutcode_sync+gitcode_syncdoes not sync files that are excluded by.gitignore, if present in the local directory.
It also does not sync.gitand.ipynbfiles.The destination directory should not be treated as an active git repo.Do not run git commands from the destination terminalon the destination directory.
The destination dir will have its contents synced to exactly match the local dir, including when you checkout a different branch on local.
Package: codeSync-tool
CodeSync: Bootstrapping Code-Text Pretrained Language Model to Detect Inconsistency Between Code and CommentCodeSync PackageCodeSync is trained on top of encoder-decoder model to learn from code-text pairs. It is a tool that uses for automated detection to identify inconsistencies between code and docstrings, and generates comprehensive summary sentence to replace the old ones.Usage ScenarioInstallationInstall the dependencies:pip-rinstallrequirements.txtInferenceSince CodeSync is a Python package, users can use it byinferencefunction.fromCodeSync.utilsimportinferenceParameters:input_file_path (str): the file path that contains source code if users want to check all the functions in there.raw_code (str): a sequence of source code ifinput_file_pathis not given.language (str, required): the programming language. We support 10 popular programming languages such as Java, JavaScript, Python, Ruby, Rust, Golang, C#, C++, C, and PHP.output_file_path (str): ifinput_file_pathis given, the results from our tool will be written in this path; otherwise, they will be printed on the screen.ExamplefromCodeSync.utilsimportinferencecode="""def inject_func_as_unbound_method(class_, func, method_name=None):# This is actually quite simpleif method_name is None:method_name = get_funcname(func)setattr(class_, method_name, func)def e(message, exit_code=None):# Print an error log message.print_log(message, YELLOW, BOLD)if exit_code is not None:sys.exit(exit_code)"""inference(raw_code=code,language='python')>>>Yourcodesnippetfunction:inject_func_as_unbound_methodResults:UNMATCH!Recommendeddocstring:Injectafunctionasanunboundmethod.-------------Yourcodesnippetfunction:eResults:MATCH!ReferenceMore details can be found in ourpaper.
If you use this code or our package, please consider citing us:@article{codesync,title={Bootstrapping Code-Text Pretrained Language Model to Detect Inconsistency Between Code and Comment},author={},journal={},pages={},year={2023}}Contact usIf you have any questions, comments or suggestions, please do not hesitate to contact us.Website:fpt-aicenterEmail:support.ailab@fpt.comLicenseMIT License
Package: codesyntax.login
codesyntax.loginAdd-on on to set login basics for CodeSyntax usersThis product is meant to be used together with pas.plugins.oidc and, if wanted, collective.regenv.It creates a user group for CodeSyntax users that will be authorized to log in in a Plone site using pas.plugins.oidcInstallationInstall codesyntax.login by adding it to your buildout:[buildout]

...

eggs =
    codesyntax.loginand then runningbin/buildoutCheck pas.plugins.oidc documentation to learn how to configure it.LicenseThe project is licensed under the GPLv2.ContributorsMikel Larreategi,mlarreategi@codesyntax.comChangelog1.0 (2023-11-22)Initial release.
[erral]
Package: codetell
CodeTell - An AI-powered tool that enables your code to tell its own story through automatic documentation generation.Example:codetell.mdinstructionsgit clone git@github.com:propella/codetell.git
cd codetell
pyenv local 3.10
python -m venv .venv --prompt codetell
source .venv/bin/activate
make install

export OPENAI_API_KEY=(Your OpenAI API Key)
codetell .
Package: codetest
codetestA simple python library which makes it easier to test code after solving a coding problem.How to Installcodetestcan be installed usingpip install codetest.requiredPython 3.6.0+pip install codetestHow to UseTo run a test, you need to pass an array of tests and the class in which the function is writtenfromcodetestimportCodeTestclassAnyName:defAnyNameFn(self,...AnyNumberOfInputs):returnresulttests=[{},...]# Call to the Test LibraryCodeTest(tests,AnyName)How to write a testcase?#index.pyfromcodetestimportCodeTestclassProblem:defsumOfTwoNumbers(self,a=2,b=2):returna+bdefmain(self,a=2,b=2):returna-btests=[#Test 0{"function":"sumOfTwoNumbers","params":{"input":[{"value":5},{"value":4},],"output":[{"value":8}]}},#Test 1{"function":"sumOfTwoNumbers","params":{#input not passed hence the function either takes default values or doesn't expect any inputs"output":[{"value":8}]}},#Test 2{# if function is not passed then `main` is executed"params":{#input not passed hence the function either takes default values or doesn't expect any inputs"output":[{"value":8}]}},]CodeTest(tests,Problem)This will result in following output--------------------------[TEST 0]--------------------------
Expected Output: 8
Computed Output: 9
                                             [Time: 0.001ms]
------------------------------------------------------------
--------------------------[TEST 1]--------------------------
Expected Output: 8
Computed Output: 4
                                             [Time: 0.001ms]
------------------------------------------------------------
--------------------------[TEST 2]--------------------------
Expected Output: 8
Computed Output: 0
                                             [Time: 0.001ms]
------------------------------------------------------------TestsTestcase Structure? - Optionaltests=[{function?:""//default"main"params?:{input?:[],output?:[]}}]Iffunctionis not provided, the default function would bemainThe order in which theinputobjects are added would be same as the params passed to thefunction.ifinputis not passed, then it is considered same as no inputs passed to the functionifoutputis not passed, then the test doesn't expect any output to be returned from the function.ifparamsis not passed, then the function is executed as-is with no input and outputInput/Output Structure? - Optional{value:any,type?:any,}Supported Typesintfloatlisttupledictsetboollinkedlistbinarytree
Package: codetestsol
codetestsol

                      |
                      |
                      |

                  functions

                      | 
                      |  
                      |
      ---------------------------------
      |               |               |      
      |               |               |
      |               |               |               
  csv_json       data_summary     sql_insert$fromcodetestsolimportfunctionsfunctions.csv_json("sample.csv")functions.data_summary("sample.csv")functions.sql_insert("sample.csv")
Package: codethecity-slackbot
SlackBot----Python based Slack Bot that makes use of `Python SlackClient`_The inspiration----Using `How to Build Your First Slack Bot with Python`_, I went from not knowing Python to having my first bot up and running in under an hour. Using that knowledge as a basis I managed to put this together in under a day.The following instructions are as much a reminder to myself how I did this as they are a guide to others.Installation----SlackBot is available through the Python Package Index, PyPI_, you can install it with::pip install codethecity-slackbotAlternatively, clone or fork the repository and use::python setup.py developto install locally for development. For local development you should also install the development dependencies (ideally in a ``virtualenv``) using::pip install -r requirements.txtUsage----SlackBot----SlackBot is the base class that connects to your registered Slack Bot.In order to use the class you must be using the your token from Slack. To set the environmant variable use::export SLACK_BOT_TOKEN='token'It handles the following default commands:* help - lists all other commands it provides* who created - details of the author* show selfied - shows an image of the bot* show mugshot - shows a mugshot of the botEventbriteBot----EventbriteBot is a subclass of SlackBot and provides basic querying of Eventbrite events for a given user account.It uses `Eventbrite Python SDK`_.In order to use the class you must be using the your token from Eventbrite. To set the environmant variable use::export EVENTBRITE_TOKEN='token'This is an example showing how the SlackBot class is subclassed and used.Creating a sample project with SlackBot----Setup the working environment----Create a virtual Python environment::mkdir <botname>cd <botname>virtualenv venvStart the virtual Python environemnt::source venv/bin/activateExamples----See the /examples directory for examples of the kinds of bots that you can build with SlackBot.Currently there is a bot for querying Eventbrite... _PyPI: https://pypi.python.org/pypi.. _`How to Build Your First Slack Bot with Python`: https://www.fullstackpython.com/blog/build-first-slack-bot-python.html.. _`Python SlackClient`: http://slackapi.github.io/python-slackclient/.. _`Eventbrite Python SDK`: http://eventbrite-sdk-python.readthedocs.io/en/latest/
Package: codetimer
SimpleCodeTimer !Before :=================== CODE ====================def say(what):print "say : %s" % whatsay("ho!!")=================== OUTPUT ==================say : ho!!After :=================== CODE ====================import codetimer@codetimer.methodTimerdef say(what):print "say : %s" % whatsay("ho!!")=================== OUTPUT ===================say : ho!!SimpleCodeTimer : say method costs 0.000028 seconds !
Package: code-timer
code_timerSimple python timer to use for single lines of code, or entire functions/classesNew Features!Usecode_timer.Timeras a class, context manager, decoratorOffers the most versatility and flexibility for your needsUse separatecode_timer.timerdecoratorUsecode_timer.timeitdecorator to measure the time to run the same function multiple timesUseful when comparing the efficiency of one runtime vs anotherBy default, will run the function 10,000 times.  The number of runs is configurableDO NOT USE THIS FOR RECURSIVE FUNCTIONS!!Logger allowing you to set the streaming level or hide the logging entirelyBasic Usagecode_timer.TimerAs aclass:t=Timer(name="class")t.start()# Do somethingt.stop()As acontext manager:Useful when trying to time a recursive functionwithTimer(name="context manager")ast:# Do somethingprint(f"Elapsed time:{t.elapsed_time}")As adecorator:@Timer(name="decorator")defstuff():# Do somethingcode_timer.timerWithout braces@timerdefyour_func():# Do somethingWith braces@timer(name="my_timer")defyour_func():# Do somethingcode_timer.timeitTime is reported at logging level: logging.INFOThe following assumes the standard formatting for the code_timer loggerDefaultwill repeat the function 10,000 times and report the fastest three runs@timeitdefyour_func():# Do somethingOutput:2020-03-12 21:56:46: code_timer.INFO - Best 3 of 10000 for your_func: 0.2200 ms; 0.2220 ms; 0.2232 msPass in the number of times to repeat@timeit(num_repeats=50)defyour_func():# Do somethingOutput:2020-03-12 21:56:46: code_timer.INFO - Best 3 of 50 for your_func: 0.2200 ms; 0.2220 ms; 0.2232 ms
Package: code_time_tracker
Code time tracker=================simply tracks ellapsed time of decorated code and print it when script is finished.In order to use it, just do:from code_time_tracker import code_time_trackedand later decorate your code like this:@code_time_trackeddef my_func():do_stuff()And with that, if you run a script with such decoration you'll get something like this output:]$ python sample.py... (script output if any)<Code time tracker __main__.my_func: 0:00:00.001063 timedelta, 2 calls>