Saravanan666/pypi-org huggingface dataset:
Package: code-tokenizers
code_tokenizersThis library is built on top of the awesometransformersandtree-sitterlibraries.
It provides a simple interface to align the tokens produced by a BPE
tokenizer with the tokens produced by a tree-sitter parser.Installpipinstallcode_tokenizersHow to useThe main interface ofcode_tokenizersis theCodeTokenizerclass. You can use a pretrained BPE tokenizer from the populartransformerslibrary, and a tree-sitter parser from thetree-sitterlibrary.To specify aCodeTokenizerusing thegpt2BPE tokenizer and thepythontree-sitter parser, you
can do:fromcode_tokenizers.coreimportCodeTokenizerpy_tokenizer=CodeTokenizer.from_pretrained("gpt2","python")None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.You can specify any pretrained BPE tokenizer from thehuggingface
hubor a local directory and the language to parse the
AST for.Now, we can tokenize some code:frompprintimportpprintcode="""def foo():print("Hello world!")"""encoding=py_tokenizer(code)pprint(encoding,depth=1){'ast_ids': [...],
 'attention_mask': [...],
 'input_ids': [...],
 'is_builtins': [...],
 'is_internal_methods': [...],
 'merged_ast': [...],
 'offset_mapping': [...],
 'parent_ast_ids': [...]}And we can print out the associated AST types:NoteNote: Here the N/As are the tokens that are not part of the AST, such
as the spaces and the newline characters. Their IDs are set to -1.forast_id,parent_ast_idinzip(encoding["ast_ids"],encoding["parent_ast_ids"]):ifast_id!=-1:print(py_tokenizer.node_types[parent_ast_id],py_tokenizer.node_types[ast_id])else:print("N/A")N/A
function_definition def
function_definition identifier
parameters (
N/A
N/A
N/A
N/A
call identifier
argument_list (
argument_list string
argument_list string
argument_list string
argument_list )
N/A
Package: codetools
The codetools project includes packages that simplify meta-programming
and help the programmer separate data from code in Python. This
library contains classes that allow defining simple snippets, or
“blocks”, of Python code, analyze variable dependencies in the code
block, and use these dependencies to construct or restrict an
execution graph. These (restricted) code blocks can then be executed
in any namespace. However, this project also provides a
Traits-event-enhanced namespace, called a “context”, which can be used
in place of a vanilla namespace to allow actions to be performed
whenever variables are assigned or retrieved from the namespace. This
project is used as the foundation for the BlockCanvas project.
Package: code-to-pdf
PDF code proyect generatorSpending many hours in front of a screen can be tiring. Sometimes we need to analyze libraries that are used in our application and to give our eyes a break, this program could be usefull. Its input is a folder that contains files of code, and the output is a pdf document of highlighted source. Also, at the beginning an index is added, which indicates the page number per each file of code.Installationpipinstallcode_to_pdfYou will also needwkhtmltopdf. In Ubuntu:sudo apt install wkhtmltopdfUsagecode_to_pdf --title output_document  path/to/project/dir/It will generate a file named "ouptut_document.pdf"
Package: code-to-text
Code to TextA tool to extract all code from a project into a single markdown or text file. Useful for inputting code into large language models.InstallationInstall the package using pip:pipinstallcode-to-textUsage
Extract code from the current directory into a file named all_code.txt:all_codeSpecify a directory to extract code from and a file to write the code to:all_code--dir_pathpath/to/my/directory--output_pathmy_output_file.txtSpecify the file extensions to consider as code files:all_code--code-extensionspyjavajscppcrbgorsSpecify the files and directories to exclude:all_code--exclude-filesinit.pysetup.py--exclude-dirs.git__pycache__distBy default, code_extractor uses a set of common code file extensions, excludes a list of common files (likeinit.py and setup.py), and excludes a list of common directories (like .git andpycache). These defaults are defined in main.py, and you can change them by editing the file. For example, to change the default code file extensions, edit the DEFAULT_CODE_EXTENSIONS variable:DEFAULT_CODE_EXTENSIONS=['py','java','js','cpp','c','rb','go','rs']To change the default files to exclude, edit the DEFAULT_EXCLUDE_FILES variable:DEFAULT_EXCLUDE_FILES=['__init__.py','setup.py','README.md']And to change the default directories to exclude, edit the DEFAULT_EXCLUDE_DIRS variable:DEFAULT_EXCLUDE_DIRS=['.git','__pycache__','dist']Please remember to maintain good security practices and not edit or share themain.pyfile if it contains sensitive information.
Package: codetrace-pse
CoDeTRAce PSENothing really fancy here. This is just a sample project for GitLab CI/CD Demo.RequirementsThese applications should be installed on your computer.Python 3.xRepositoryPyPiGitLabInstallation via pipDownloading the packageOpen yourwindows terminal.Go to your working directory (e.g. Desktop) then install using thepipcommand.cd %USERPROFILE%\Desktop\
pip install codetrace-pseTesting the installationExecuting below command should output thehelpdocument.pse-cli -h

usage: pse-cli [-h] -s SYMBOL

CoDeTRAce PSE-CLI v1.0.0

optional arguments:
  -h, --help            show this help message and exit
  -s SYMBOL, --symbol SYMBOL
                        Symbol of the stock you want to check. (e.g. BPI, JFC)Sample run with argumentspse-cli -s JFC

================================================
CoDeTRAce PSE-CLI v1.0.0
================================================
Name            : Jollibee Foods Corporation
Symbol          : JFC
Current Price   : P193.00 (-1.03%)
Previous Price  : P195.00
Open            : P195.00
Volume          : 813,110
52-Week High    : P228.00
52-Week Low     : P91.10
Shares          : 1,107,698,270
================================================
Source : https://www.pesobility.com/stock/JFC
================================================
Package: code-var
变量命名工具输入关键字vn中文变量名，如：➜ vn 我和我的祖国
小驼峰法 | meAndMyMotherland 
大驼峰法 | MeAndMyMotherland 
下划线法 | me_and_my_motherland 
前下划线法 | _me_and_my_motherland
Package: codeviking.astro.units
codeviking.astro.units README===========================Physical unit converson for astronomical calculations.Installation------------pip install codeviking.astro.unitsDocumentation-------------http://codeviking-astro-units.readthedocs.org/Support-------See the project home page athttps://bitbucket.org/codeviking/python-codeviking.astro.units/to file a bug report or request a feature.
Package: codeviking.random
Random number utility functions and generators.  Provides cross-language
random number generator compatibility (the same seed will yield the same
sequence in all supported languages).This library is avaialable in the following languages:Dart:Not yet releasedPython:https://bitbucket.org/codeviking/python-codeviking.randomScala:Not yet releasedInstallationpip install codeviking.randomDocumentationhttp://codeviking-random.readthedocs.org/SupportSee the project home page athttps://bitbucket.org/codeviking/python-codeviking.random/to file a bug report or request a feature.
Package: code-vision-cli
Code Vision - Command Line Interface (CLI)Code Vision CLI is a powerful tool for detecting plagiarism in source code, drawing inspiration from two pivotal research papers in the field. The first paper, titled "A Clustering Approach for Detecting Plagiarism in Source Code Data sets," and the second, "A Hybrid Method for Detecting Source-code Plagiarism in Computer Programming Courses," provide the foundational methodologies for our program. This tool excels in analyzing a collection of source files, identifying instances of plagiarism, and presenting these findings through an intuitive visual format, utilizing a weighted graph clustering algorithm.This project harnesses the capabilities of well-regarded open-source compilers and parsers, notablypycparser, which is predominantly used for research and experimental endeavors. Code Vision CLI is particularly adept with the C99 standard, ensuring broad applicability and relevance in various coding environments.You can check our whitepaper hereCodeVisionInstallationpip install code-vision-cliUsagepython code-vision-cli -i input -o output -a lcs -t 0.8Manual-h, --help            show this help message and exit
  -i IN_DIR, --in_dir IN_DIR
                        Input directory must be in the project folder
  -o OUT_DIR, --out_dir OUT_DIR
                        Output directory must be in the project folder
  -a {jaccard,lcs}, --algorithm {jaccard,lcs}
                        Algorithm to use: "jaccard" or "lcs"
  -t THRESHOLD, --threshold THRESHOLD
                        Threshold value between 0.00 and 1.00ContributionsWe openly welcome pull requests! If you're interested in contributing to the development of Code Vision CLI, your input and code contributions would be greatly appreciated.LicenseThis project is released under theMIT License. Feel free to utilize, modify, and distribute this tool in accordance with the license specifications.
Package: code-wake-sql13-store
Python code wake SQL Academy 1.4 store adapter (pycodewake-sql13-store)This store adapter provides backing via SQL Academy 1.3 for Code Wake.
Use pycodewake-sql14-store if you are integrating with SQL Alchemy 1.4.For example:importcode_wakefromcode_wake_sql13_storeimportSql13Storecwproc=code_wake.Process(app_name="my_app",app_vsn="1.2.3",env_name="production",store=Sql13Store("sqlite:////tmp/some_file.sqlite"),)
Package: code-wake-sql14-store
Python code wake SQL Academy 1.4 store adapter (pycodewake-sql14-store)This store adapter provides backing via SQL Academy 1.4 for Code Wake.For example:importcode_wakefromcode_wake_sql14_storeimportSql14Storecwproc=code_wake.Process(app_name="my_app",app_vsn="1.2.3",env_name="production",store=Sql14Store("sqlite:////tmp/some_file.sqlite"),)
Package: code-wake-v1rest-store
Python Code Wake V1 REST API store adapter (pycodewake-v1rest-store)This store adapter provides backing via the V1 REST API for Code Wake. A server
implementing this API may be achieved by using pycodewake-v1wsgi-service (a middleware
you could use to provide the API via a Flask server say, if that suits.For example:importcode_wakefromcode_wake_v1rest_storeimportV1RestStorecwproc=code_wake.Process(app_name="my_app",app_vsn="1.2.3",env_name="production",store=V1RestStore("https://code.wake.server/path/to/api"),)
Package: code-wake-v1wsgi-service
Python Code Wake V1 WSGI Werkzeug middleware (pycodewake-v1wsgi-service)This store adapter provides a WSGI Werkzeug middleware which provides an implementation of the V1 REST API service.For example:importflaskfromcode_wake_v1wsgi_serviceimportV1WsgiMiddlewarefromcode_wake_sql14_storeimportSql14Storeflask_app=flask.Flask(__name__)flask_app.wsgi_app=V1WsgiMiddleware(flask_app.wsgi_app,"/some/v1/code_wake/path",Sql14Store("sqlite:///:memory:"))Here, a flask server is created, and the middleware added to it. The parameters for the middleware are
the URL base path (on top of which/processes,/eventsand any other restful resources will be
added) and the back end store.A remote process may then use thecode-wake-v1rest-storeCode Wake store adapter, and via this
middleware, communicate to the back end store provided.No authentication is provided by the middleware.
Package: code-wallet
Code Wallet Python SDKThe Code Wallet Python SDK is a module that allows Python developers to integrate Code into their applications. Seamlessly start accepting payments with minimal setup and just a few lines of code.See thedocumentationfor more details.What is Code?Codeis a mobile wallet app leveraging self-custodial blockchain technology to provide an instant, global, and private payments experience.InstallationYou can install the Code Wallet Python SDK from PyPI:pipinstallcode-walletUsageHere's a simple example showcasing how to create a payment intent using the Python SDK:fromcode_wallet.client.intentsimportpayment_intentstest_data={'destination':"E8otxw1CVX9bfyddKu3ZB3BVLa4VVF9J7CTPdnUwT9jR",'amount':0.05,'currency':'usd',}# Create a payment request intentpayment_intents.create(test_data)# Verify the intent statuspayment_intents.get_status(id)Getting HelpIf you have any questions or need help integrating Code into your website or application, please reach out to us onDiscordorTwitter.ContributingFor now the best way to contribute is to share feedback onDiscord. This will evolve as we continue to build out the platform and open up more ways to contribute.
Package: codewars
Make sure to install all the dependencies needed for each individual module.DependenciesRequired:- `sudo apt-get install gcc`
- `sudo apt-get install libbluetooth-dev`Install latest version (stable)pip install codewarsAlternative versions1. Go to "https://github.com/0x78f1935/codewars/releases" and do
2. Download the latest version, unzip it.
3. Open a virtualenv and navigate to the extracted folder.
4. Now install the wheel package:
    `python -m pip install codewars-x_x_x_whl`Install development version (unstable)pip install git+https://github.com/0x78f1935/codewars@masterDockerThere is also aDockerfileand adocker-compose.yamlfile which include a
python build where codewars will be preinstalled. You can modify the dockerfile
to your liking. TheDockerfiledownloads always the unstable version bydefault.ExamplesInfoRefer for detailed documentation tohereIn the following section you will find a brief example on how to use this
code. This library is ment to grow over time so more examples to come...LoggerExample:
```
from codewars.logger import Logger
logger = Logger(appname="test", mode="DEBUG", write=False)
logger._testLoggerClass()
logger.info("Hello World!")
```NoteThe whole module makes use of theLoggerclass instead of theprintmethod.UnitTestsExample:
```
from codewars.unittest import Test
print(Test().run())
```BlueToothExample:
```
from codewars.bluetooth import Bluetooth
bt = Bluetooth()  # Initialize the class, Scans once
scan_results1 = bt.scan()  # Scan area for the default 10 seconds, this is \
# also executed when this class initializes
scan_results2 = bt.run_until_discovered()  # Scan until a device is found
print("Scan results1: {}".format(scan_results1))
print("Scan results2: {}".format(scan_results2))
```WifiExample:
```
from codewars.wifi import Wifi
wifi = Wifi("enp0s31f6")
sniff_results = wifi.sniff(totalResults=10)
print(sniff_results)
info_results = wifi.info(sniff_results)
print(info_results)
wifi.sniff_forever(duration=300)
```SurferExample:
```
from codewars.surf import Surfer
from asyncio import get_event_loop
surf = Surfer(loop=get_event_loop())
# GET METHODS
print(surf.get(url='http://httpbin.org/get')) # Read page
print(surf.get(url='http://httpbin.org/get', json=True)) # Read json
print(surf.get(url='http://httpbin.org/basic-auth/test/test1123', auth=('test', 'test1123'), json=True))
# POST METHODS
print(surf.post(
    url='http://httpbin.org/post',
    header={'api_key': 'special-key'},
    data={
        "id": 0x78f1935,
        "username": "codewars",
    },
    json=True
    ))
```ScraperExample
```
from codewars.scraper import Scraper
scraper = Scraper(debug=True)
scraper.hrefs(url = 'https://codewars.nl/space')
```Refer for detailed documentation tohere
Package: codewars-api-py
Effortlessly interact with the Codewars API using this Python wrapper. Simplify user, challenge, and leaderboard data retrieval, making integration seamless for your projects.Table of ContentsFeaturesGetting StartedDocumentationContributingLicenseFeaturesUser Information:Retrieve detailed user information including username, honor, skills, ranks, and completed challenges.Completed Challenges:Get a list of challenges completed by a user, including details like challenge name, completion date, and programming languages used.Authored Challenges:List challenges authored by a specific user with information on ranks, tags, and available languages.Code Challenge Details:Obtain detailed information about a specific code challenge, including its name, description, tags, and user statistics.Getting StartedInstall the package:pipinstallcodewars-api-pyUse the wrapper in your Python script:fromcodewars_api_pyimportCodewarsAPI# Initialize the Codewars API wrappercodewars_api=CodewarsAPI()# Example: Get user informationuser_info=codewars_api.get_user("some_user")print(user_info)# Example: List completed challengescompleted_challenges=codewars_api.list_completed_challenges("some_user")print(completed_challenges)DocumentationFor detailed information on available methods and usage, refer to theCodewars API Wrapper Documentation.ContributingContributions are welcome! Please check theContributing Guidelinesfor more details.LicenseThis project is licensed under the GPL V3 License - see theLICENSEfile for details.
Package: codewars-cli
codewars-cliAn unofficial CLI for CodeWars.ConfigurationYou need to set theCW_SESSION_IDandCW_REMEMBER_USER_TOKENenvironment variables which you can grab from your cookies.Rich will look atMANPAGERthen thePAGERenvironment variables (MANPAGERtakes priority) to get the pager command. On Linux and macOS you can set one of these toless -rto display the description with ANSI styles.InstallationYou can installcodewars-cliusingpip:pip install codewars-cliUsage$ codewars-cli --help
Usage: codewars-cli [OPTIONS] COMMAND [ARGS]...

  An unofficial CLI for CodeWars.

Options:
  --help  Show this message and exit.

Commands:
  attempt   Attempt to pass the full test suite.
  practice  Search for a kata.
  submit    Submit your solution.
  test      Test against the sample tests.
  train     Choose a kata to solve.You can do the same for each subcommand.
Package: codewars-test-teey
Codewars Test Framework for PythonSee alsoThis is a fork fromhttps://github.com/Codewars/python-test-frameworkExamplefromsolutionimportaddimportcodewars_testastest@test.describe('Example Tests')defexample_tests():@test.it('Example Test Case')defexample_test_case():test.assert_equals(add(1,1),2,'Optional Message on Failure')
Package: codewatch
This project is currently deprecated and may be archived. If you're looking for something similar, you could trybellybuttonorwriting a custom checker in pylint instead.OverviewMonitor and manage deeply customizable metrics about your python code using ASTs.Codewatch lets you write simple python code to track statistics about the state of your codebase and write lint-like assertions on those statistics. Use this to incrementally improve and evolve the quality of your code base, increase the visibility of problematic code, to encourage use of new patterns while discouraging old ones, to enforce coding style guides, or to prevent certain kinds of regression errors.What codewatch does:Traverses your project directoryParses your code into AST nodes and calls your visitor functionsYour visitor functions run and populate a stats dictionaryAfter all visitor functions are called, your assertion functions are calledYour assertion functions can assert on data in the stats dictionary, save metrics to a dashboard, or anything you can think ofInstallationPython: 2.7, 3.6, 3.7Execute the following in your terminal:pipinstallcodewatchUsagecodewatch codewatch_config_modulecodewatch_config_moduleis a module that should contain your visitors, assertions and filters (if required)VisitorsYou should use the@visitdecorator.
The passed in node is anastroidnode which follows a similar API toast.Nodefromcodewatchimportvisitdef_count_import(stats):stats.increment('total_imports_num')@visit('import')defcount_import(node,stats,_rel_file_path):_count_import(stats)@visit('importFrom')defcount_import_from(node,stats,_rel_file_path):_count_import(stats)This will build a stats dictionary that contains something like the following:{"total_imports_num":763}AssertionsOnce again in thecodewatch_config_moduleyou can add assertions against this stat dictionary using the@assertiondecoratorfromcodewatchimportassertion@assertion()defnumber_of_imports_not_too_high(stats):threshold=700actual=stats.get('total_imports_num')err='There were{}total imports detected which exceeds threshold of{}'.format(actual,threshold)assertactual<=threshold,errIn this case, the assertion would fail since 763 is thenewStatand the message:There were 763 total imports detected which exceeds threshold of 700would be printedFiltersYou can add the followingoptionalfilters:directory_filter (defaults to skip test and migration directories)# visit all directoriesdefdirectory_filter(_dir_name):returnTruefile_filter (defaults to only include python files, and skips test files)# visit all filesdeffile_filter(_file_name):returnTrueTune these filters to suit your needs.ContributingSeethe Contributing docsContributorsThanks goes to these wonderful peopleemoji key:Josh Doncaster Marsiglio💻Rohit Jain💻Chris Abiad💻Francois Campbell💻Monica Moore🎨Jay Crumb📖Jake Bolam🚇Shouvik D'Costa📖Siavash Bidgoly🚇Noah Negin-Ulster💻Vardan Nadkarni💻greenkeeper[bot]🚇Kazushige Tominaga💻We welcome contributions from the community, Top Hatters and non-Top Hatters alike. Check out ourcontributing guidelinesfor more details.CreditsSpecial thanks toCarol Skellyfor donating the 'tophat' GitHub organization.
Package: code-with-finn
code_with_finnA small module that brings the good dog Finn into your Jupyter notebooks.While Finn can warn you after errors, he can also celebrate successes!He can also help you prepare yourself before a long stack trace.You can send him away if you need to:Or keep him away withcode_with_finn.announce_errors(False)code_with_finn.celebrate_success(False)InstallationInstall withpip install code_with_finn
Package: codewithgpu
CodeWithGPUis a community that focuses on the reproducible AI algorithms. It has close links withGithubby leveraging the managed code, and distributes corresponding docker images, models and logs for friendly reproduction.This repository provides a novel data loading solution that maps data between Python object and serialized bytes automatically. This solution encourages developers to build a hierarchical data loading pipeline, which decouples the reading, transforming and batching. Similar solution, such asNVIDIA DALI, is widely deployed in many HPC systems and ML benchmarks.Besides, it considers a modular and asynchronous design for the inference of AI models. Developers can easily serve their models on distributed devices by creating a many-to-many "Producer-Consumer" dataflow, and the flow control is dealt by the synchronous queues. By this way, model serving resembles training and can also get great benefit from the efficient data loader.Also, it develops the benchmarks of modern AI models on diverse accelerators, including the newest NVIDIA GPUs and Apple Silicon processors. It will help users to match their demand on picking the best suitable devices.“The more reasonable GPUs you buy, the more money you save.”InstallationInstall from PyPI:pipinstallcodewithgpuOr, clone this repository to local disk and install:cdcodewithgpu&&pipinstsall.You can also install from the remote repository:pipinstallgit+ssh://git@github.com/seetacloud/codewithgpu.gitQuick StartDeploy Image Inference ApplicationSeeExample: Image Inference.Use Record Dataset To Accelerate Data LoadingSeeExample: Record Dataset.Model BenchmarksSeeDoc: Model Benchmarks.LicenseApache License 2.0