Saravanan666/pypi-org huggingface dataset:
Package: leetcode-data-structure
LeetCode Data StructuresThis package provides three classes for working with data structures in LeetCode problems:TreeNode: used for solving binary tree problemsListNode: used for solving linked list problemsNode: used for solving n-ary tree problems
For each of the three classes, the structure and attribute names are the same as in LeetCode.Additionally, two helper methods are provided for each class:to_array: converts an instance of the class to an array representation, which can be used in LeetCode problems.from_array: constructs an instance of the class from an array representation.
The to_array and from_array methods are useful because LeetCode often represents data structures using arrays, and converting to and from this format can be time-consuming and error-prone.InstallationTo install the package, use pip:pip install leetcode_data_structureUsageHere we use this package to solveLeetcode 100 same tree:importunittestfromdata_structureimportTreeNodeclassSolution:defisSameTree(self,p:TreeNode|None,q:TreeNode|None)->bool:ifpisNoneandqisNone:returnTrueifpisNoneorqisNone:returnFalseifp.val!=q.val:returnFalsereturnself.isSameTree(p.left,q.left)andself.isSameTree(p.right,q.right)deftest(testObj:unittest.TestCase,p_arr:list[int],q_arr:list[int],expected:bool)->None:p=TreeNode.from_array(p_arr)q=TreeNode.from_array(q_arr)so=Solution()actual=so.isSameTree(p,q)testObj.assertEqual(actual,expected)classTestClass(unittest.TestCase):deftest_1(self):test(self,[1,2,3],[1,2,3],True)deftest_2(self):test(self,[1,2],[1,None,2],False)deftest_3(self):test(self,[1,2,1],[1,1,2],False)if__name__=="__main__":unittest.main()
Package: leetcode-dl
bonfy	-	leetcode-dl=======================*leetcode-dl* is a Command-line program to download solutions from leetcode.comInstallation^^^^^^^^^^^^=====================Installing from PyPI=====================Once you have `pip3`, execute:.. code-block:: shell$ pip3 install leetcode-dl=======================Installing source code=======================First you need to clone `python-openflow` repository:.. code-block:: shell$ git clone https://github.com/bonfy/leetcode-dl.gitAfter cloning, the installation process is done by `setuptools` in the usualway:.. code-block:: shell$ cd leetcode-dl$ python3 setup.py installUsage^^^^^.. code-block:: shell$ leetcode-dl$ leetcode-dl -h|help     help page$ leetcode-dl -set        set config$ leetcode-dl -show       show config$ leetcode-dl -readme     generate|update readme$ leetcode-dl -q qid      download by qid(like 1 2 16)
Package: leetcodeHelper
This project helps you to do leetcode with your preferred IDE or editor with command-line interface (CLI).Getting StartPrerequisitesWindows 10, MacOS, Linuxchrome version >=90.0.4430Installation# Prepare your virtual environment
conda create --name [env_name] python=3.9
conda activate [env_name]

# Install this package
pip install leetcodeHelperUsage# This command helps to load Chrome driver for you 
leetcode --init

# This CLI supports querying problems by names
leetcode --name two-sum  
leetcode --name add-two-numbers
leetcode --name median-of-two-sorted-arraysThen question description and starter code will be automatically generated into question-name.py file. Now, you can do leetcode whenever in your preferred IDE.AcknowledgmentsThe part of Chrome driver installation is modified from@peterhudecproject.Also, this project is inspired by@allenyummy's project.Next release versionFix the format error in the result file (change line missing).Crawl by the Number/Tag/Level/Category of the questions.Post your code back to leetcode platform and check all testcases. Retreive results.Docker version
Package: leetcode-python
ID GeneratorA package used to generate random ids of variable lengths and types.How to useAfter installing the package use following import:from idgenerator import generate_password,generate_guid,generate_credit_card_number,
generate_pin_number,
generate_object_idThen use following commands:password = generate_password(length= 'your_desired_length')guid = generate_guid()credit_card_number = generate_credit_card_number(length='your_desired_length')pin = generate_pin_number(length='your_desired_length')objid = generate_object_id()
Package: leetcode-runner
OverviewLeetCode solutions runnerInstallationInstall it directly into an activated virtual environment:$ pip install leetcode-runneror add it to yourPoetryproject:$ poetry add leetcode-runnerUsageInstall the library from PyPiGo toLeetCodeand pick a problem to solveCopy the title slug from the URL (e.gis-subsequence) and execute in your terminal:leetcodepullis-subsequenceIt will create a file called392-is-subsequence.pyand you can start coding straight
away!python392-is-subsequence.py# or like this, depends on how you manage your pythonpoetryrunpython392-is-subsequence.py

------------------------------[FAILED]s="abc",t="ahbgdc"Expected:True
Actual:None
------------------------------[FAILED]s="axc",t="ahbgdc"Expected:False
Actual:None

Passed:0/2By default a methodSolutiondoesn't do anything, that's why the answer is None. You
need to actually solve the problem 😉.Please read the next section to undestand how it works and also check thelimitationssection.Usage (manual)This is a legacy way to work with this libraryInstall the library from PyPiGo toLeetCodeand pick a problem to solveOpen your favourite IDE and import theleetcode_runnerCopy problem samples into some variable, like aproblem, and copy the baseSolutionclass that LeetCode providesLeetCode(problem, Solution).check()will run these samples!Pass your own samples intocheckfunctionfromleetcode_runnerimportLeetCode,TestCase,Argsfromtypingimport*# Copied as is from the LeetCodeproblem="""Example 1:Input: nums = [2,7,11,15], target = 9Output: [0,1]Output: Because nums[0] + nums[1] == 9, we return [0, 1].Example 2:Input: nums = [3,2,4], target = 6Output: [1,2]Example 3:Input: nums = [3,3], target = 6Output: [0,1]"""classSolution:deftwoSum(self,nums:List[int],target:int)->List[int]:return[1,2]LeetCode(problem,Solution).check()Will print:------------------------------
[ FAILED ]
nums = [2,7,11,15], target = 9
Expected: [0, 1]
Actual  : [1, 2]
------------------------------
[ OK ]
nums = [3,2,4], target = 6
Expected: [1, 2]
Actual  : [1, 2]
------------------------------
[ FAILED ]
nums = [3,3], target = 6
Expected: [0, 1]
Actual  : [1, 2]

Passed: 1/3Providing custom cases is also possible:lc=LeetCode(problem,Solution)lc.check(extra_cases=[TestCase(args=Args(nums=[0,1,2],target=3),answer=[1,2]),# orTestCase(Args(nums=[0,1],target=1),[0,1])])Code snippetJust copy & paste this in your IDE and start coding:fromleetcode_runnerimportLeetCode,TestCase,Argsfromtypingimport*PROBLEM=""""""classSolution:passLeetCode(PROBLEM,Solution).check(extra_cases=[])RequirementsPython 3.9+LimitationsThis tool uses Leetcode's GraphQL API under the hood, I'm not sure how long will it be
available for public usageThis tool can download only public problems. Subscription-based requires
authentication that is currently not implementedThis project was generated withcookiecutterusingjacebrowning/template-python.
Package: leetcodetest
Leetcode TestA package that allows you to test leetcode answers with minimal setup.Installationpip3installleetcodetestUsage1. Import Leetcodetest:fromleetcodetestimportLeetcodeTester2. Copy the Solution class:classSolution:defarrayIntoInteger(self,arr):returnsum(arr)3. Specifcy the input and expected output:LeetcodeTester.test(Solution,givenInput=[1,2,3],expectedOutput=6)Ready! Work on your problem and run the file to see your results.Note: LeetcodeTest automatically finds the method to test your solution, to do so it looks for methods that do not start with _.
You may have only one method which is usually provided by Leetcode. Prefix other methods using _.# ForbiddenclassSolution:defmy_method(self):print("Not OK")self.my_method_two()defmy_method_two(self):print("Not OK")# Correct usageclassSolution:defmy_method(self):print("OK, I am executed by LeetcodeTest")self._my_method_two()def_my_method_two(self):print("OK")ContributionsContributions are welcome at any time.MaintainersName@Asmeili
Package: leetcode-tester
leetcode_tester在leetcode做题时，感觉提交代码时，效率受制于网络。Leetcode的编辑器环境也不是很顺手，常常急躁提交留下失败的提交记录。
遂简单写了个本地测试框架，方便在本地进行测试。安装方法pip install leetcode-tester使用方法使用示例from leetcode_tester import Tester


class Solution():
    def sfc(self, *args):
        # TODO: write your code here
        # Example:
        return sum(args)


if __name__ == '__main__':
    solution = Solution()
    test = Tester(solution.sfc)
    # TODO: add test case here
    # Example:
    test.addTest(1, 2, 3)
    test.addTest(2, 4, 6)
    test.doTest()Solution类可以选择从Leetcode的编辑器中复制而来。当然，有些额外的特殊类型，还是需要自己补充。Tester的addTest方法用于添加用例，最后一个入参会被作为期待结果，之前的参数会被作为入参传入Solution方法。输出示例Input: [1, 2, 3]
Expect: [3]
Result: [3]
Status: [RIGHT]
Exception: [None]
Cost: [7.152557373046875e-06]

Input: [2, 4, 6]
Expect: [6]
Result: [6]
Status: [RIGHT]
Exception: [None]
Cost: [3.0994415283203125e-06]

{'TOTAL': 2, 'RIGHT': 2, 'WRONG': 0, 'EXCEPTION': 0, 'TOTAL_COST': 1.0251998901367188e-05}TODO持续整理LeetCode中遇到的额外类型，例如：ListNode、TreeNode，并将其固化在这个包里以供用户直接使用。
Package: leetcode-with-me
leetcode-with-meA small tool for writing solutions to LeetCode problems.FeaturesInitialize a directory with Git and connect to a GitHub repo.Create a solution from defaulttemplatefor writing LeetCode solutions.Set up you own writing template.Add/Remove categories which LeetCode problems belong to.Upload solutions to GitHub repo.Support executing commands in any directory.Support markdown format.Installation$ pip install leetcode-with-meUsageInitialize a directory and connect to GitHub repo.$ lc init <directory> <remote repo>Create a solution markdown for you.$ lc new <solution name> <solution category>Set up your own writing template.$ lc template -set <template path>Add/Remove a category.$ lc category add <category>$ lc category rm  <category>Upload solutions to the GitHub repo.$ lc uploadSeelc --helpfor more command-line switches and usage instructions.DevelopmentI would love to hear what you think aboutleetcode-with-meon issues pageMake pull requests, report bugs, suggest ideas and discussleetcode-with-me.LicenseMIT
Package: leetcron
leetcronA CLI tool for setting up a cron job that pushes recent leetcode submissions to a specified Github repo.0.1.0 UpdatesAdded support for the latest languages on LeetcodeAdded handling to prevent cron job failing from unrecognized languageInstallationpip install leetcronSetupleetcron setupOptions-gGithub setup-cLeetcode cookie setup-jCronjob setupNotesObtain a Github Access Token through the stepshereMake sure you are logged into Leetcode on Chrome or Firefox before running the setup.Try runningleetcron setup -cto grab the newest Leetcode cookie if task fails.Push recent submissions to repo manuallyleetcron run
Package: leeteasy
LeetEasyDesktop notification for easy daily challenges inleetcode.We all knowLeetcode'sdaily challenges are awesome :sunglasses: However, sometimes these challenges are quite difficult for people who are just starting out problem-solving 	:smiling_face_with_tear:This tool will send desktop notification when anEasydaily problem is published. This way you won't miss any opportunity to grab some easyLeetcoins:coin: and stay motivated for the day :fire:Requirementspython >= 3.8InstallationpipinstallleeteasyrunSchedule leeteasy to send notification for easy leetcode problem at 14:30 (24 hours format time)python-mleeteasystart14:30&To add additional difficultypython-mleeteasystart14:30--difficultymedium&This will schedule leeteasy forEasy and Mediumproblem.To stop leeteasypython-mleeteasystopNOTE:By defaultleeteasychecks for scheduled task in every 1 hour/3600 seconds.
So there might be 1-hour delay from the actual scheduled time while getting the notification. However,
this can be controlled using--sleep_durationoption.Linux cronjob guideSet a cronjob to automatically startleeteasyat system boot.# open cronjob editorcrontab-e# add the following line@rebootpython-mleeteasystart14:30&ContributingWe are very happy to see you here. Before sending your pull requests, make sure that you read the whole workflow and the naming conventions mentioned in thecontributing guidelines.If you have any doubts regarding the contributing guidelines, please feel free tostate it clearly in an issue. All the best!
Package: leetehao
FeaturesConvert/inverse leet codeConvert/inverse morse codeConvert/inverse roman codeExamplesMorse>>>fromleetehaoimportmorse>>>morse.encode('hello world')'.... . .-.. .-.. --- / .-- --- .-. .-.. -..'>>>morse.encode('.... . .-.. .-.. --- / .-- --- .-. .-.. -..')'HELLO WORLD'Leet>>>fromleetehaoimportleet>>>leet.encode('hello world')'}{[-[_[_()  vv()[z[_|)'>>>leet.encode('}{[-[_[_()  vv()[z[_|)')'HELLO WORLD'Roman numerals>>>fromleetehaoimportroman>>>roman.encode(2549)'MMDXLIX'>>>roman.encode('MMDXLIX')2549LicenseFree software: BSD licenseHistory0.1.0 (2015-09-21)Added Leet and Morse both function and class typeAdded limited Roman functionCollect and made constants overwritable
Package: leetnode
LeetNodeA small Python 3.5+ library to make debugging LeetCode binary tree, linked list and matrix problems more convenient.Binary Treesfrom leetnode import TreeNode, build_btreeCreating a binary tree nodebtree_node = TreeNode('val')Creating a binary tree from a listbtree1 = build_btree([3, 9, 20, 8, 16, 15, 7, 1, 2, None, None, 3, None, None, None, None, None, 12])orbtree2 = TreeNode.from_list(['a', 'b', 'cd', None, 'ef', 'gh', 'i', None, None, None, None, 'jkl', 'mn', 'o'])or, from a JSON stringbtree3 = TreeNode.from_list('[1, null, 555555, null, 43, 1]')Printing a list representation of a binary tree>>> print(btree1)
[3, 9, 20, 8, 16, 15, 7, 1, 2, None, None, 3, None, None, None, None, None, 12]

>>> print(btree2)
['a', 'b', 'cd', None, 'ef', 'gh', 'i', None, None, None, None, 'jkl', 'mn', 'o']

>>> print(btree3)
[1, None, 555555, None, 43, 1]Printing a tree representation of a binary tree>>> print(btree1.tree_string())
           ___3_____
          /         \
    _____9          _20
   /      \        /   \
  8___     16     15    7
 /    \          /
1     _2        3
     /
    12

>>> print(btree2.tree_string())
   ______'a'______
  /               \
'b'_            __'cd'___________
    \          /                 \
    'ef'     'gh'              __'i'_
                              /      \
                          _'jkl'     'mn'
                         /
                       'o'

>>> print(btree3.tree_string())
1__
   \
  555555__
          \
           43
          /
         1Linked Listsfrom leetnode import ListNode, build_linked_listCreating a linked list nodelist_node = ListNode('val')Creating a linked list from a listllist1 = build_linked_list(['a', 'b', 'c', 'd'])orllist2 = ListNode.from_list([1, 2, 3, 4, 5])or, from a JSON stringllist3 = ListNode.from_list('["e", "f", "g", "h"]')Printing a linked list>>> print(llist1)
['a' -> 'b' -> 'c' -> 'd']

>>> print(llist2)
[1 -> 2 -> 3 -> 4 -> 5]

>>> print(llist3)
['e' -> 'f' -> 'g' -> 'h']Iterating over a linked list>>> for node in llist1:
...     print(node.val + node.next.val if node.next is not None else node.val)
...
ab
bc
cd
dMatricesPrinting a matrix>>> mat1 = [[1.2, 2.33, 3.0], [4.5, 6.7777, 8], [9.0, 10.98, 111.42]]
>>> mat2 = [[3, 0, 8, 4], [2, 2340, 5, 7], [97, 432, 6, 3], [0, 3, 1, 13]]
>>> mat3 = mat3 = '[["a", "b", "ccc"], ["dd", "e", "ff"], ["g", "h", "i"]]'

>>> print(matrix_to_string(mat1))
[ [ 1.2   , 2.33  , 3.0    ],
  [ 4.5   , 6.7777, 8      ],
  [ 9.0   , 10.98 , 111.42 ] ]

>>> print(matrix_to_string(mat2))
[ [    3,    0,    8,    4 ],
  [    2, 2340,    5,    7 ],
  [   97,  432,    6,    3 ],
  [    0,    3,    1,   13 ] ]

>>> print(matrix_to_string(mat3))
[ [ 'a'  , 'b'  , 'ccc' ],
  [ 'dd' , 'e'  , 'ff'  ],
  [ 'g'  , 'h'  , 'i'   ] ]
Package: leetquery
LeetQueryA library for retriving Human Resource information from Leetcode.InstallpipinstallleetqueryUsageRetrieving User SubmissionsJust enter user name and limit of query!fromleetquery.userimportget_submissionssubmissions=get_submissions(username="syhaung",limit=12)return value:["question1", "question2", ...]For ProblemsRetrieving Problem DiscriptionJust enter probelm nameSlug and get the problem discription in HTML~~fromleetquery.problemimportget_discriptionsubmissions=get_discription(problemname="two-sum")return value:<p>Given an array of integers<code>nums</code>&nbsp;and an integer<code>target</code>, return<em>indices of the two numbers such that they add up to<code>target</code></em>.</p>...Retrieving Problem StatisticsGet the statistics for the problem in a JSON format, help you quantize difficultiesfromleetquery.problemimportget_statsstat=get_stats("two-sum")assertisinstance(stat,dict)and\list(stat.keys())==['totalAccepted','totalSubmission','totalAcceptedRaw','totalSubmissionRaw','acRate']return value:{'totalAccepted':'10.4M','totalSubmission':'20.6M',...}
Package: leeway
LeewayBread and butter box pushing bread slices under butter knives. Hints from previous runs are taken.License: MIT|Country of origin: Switzerland|Export control classification number(ECCN): EAR99Third party dependencies are documented in the folderthird-party.DocumentationUser and developerdocumentation of leeway.Bug TrackerAny feature requests or bug reports shall go to thetodos of leeway.Primary Source repositoryThe main source ofleewayis on a mountain in central Switzerland.
We use distributed version control (git).
There is no central hub.
Every clone can become a new source for the benefit of all.
The preferred public clones ofleewayare:on codeberg- a democratic community-driven, non-profit software development platform operated by Codeberg e.V.at sourcehut- a collection of tools useful for software development.ContributionsPlease do not submit "pull requests" (I found no way to disable that "feature" on GitHub).
If you like to share small changes under the repositories license please kindly do so by sending a patchset.
You can either send such a patchset per email usinggit send-emailor
if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork atsourcehut.StatusExperimental.Note: The default branch isdefault.
Package: lef
Python Extension FrameworkThis is a framework for buildingAWS Lambda Extensions.Quickstart$pipinstalllefTo get started you can use the defaultExtensionclass, or extend it.Example:importlefdefhandler(event):print(event)extension=lef.Extension()extension.register([lef.EventType.INVOKE],handler)DevelopmentInstall Dependencies$poetryinstall--devBump VersionYou can use thebin/bumpscript to bump the version. This is a wrapper forbumpversion.$bin/bump<VERSIONLEVEL>
Package: lefaso-net-scraper
lefaso-net-scraperDescriptionlefaso-net-scraper is a robust and versatile Python library designed to efficiently extract articles from the popular online news source of of Burkina Faso,www.lefaso.net. This powerful scraping tool allows users to effortlessly collect article content and data from Internet users’ comments on lefaso.net.ImportantOur scraper, like other scrapers, is based on the structure of the target website. Changes to the website's structure can affect the scraper. We use automated workflows to detect these issues frequently, but we cannot catch all of them. Please report any issues you encounter and use the latest version.Data FormatFieldDescriptionarticle_topicarticle topicarticle_titlearticle titlearticle_published_datearticle published datearticle_originarticle originarticle_urlarticle urlarticle_contentarticle contentarticle_commentsarticle commentsInstallationWith poetrypoetryaddlefaso-net-scraper
poetryupdatelefaso-net-scraper# to update the packageWith pippipinstall--upgradelefaso-net-scraperUsage# coding: utf-8fromlefaso_net_scraperimportLefasoNetScrapersection_url='https://lefaso.net/spip.php?rubrique473'scraper=LefasoNetScraper(section_url)data=scraper.run()Settings Pagination range# coding: utf-8fromlefaso_net_scraperimportLefasoNetScrapersection_url='https://lefaso.net/spip.php?rubrique473'scraper=LefasoNetScraper(section_url)scraper.set_pagination_range(start=20,stop=100)data=scraper.run()Save data to csv# coding: utf-8fromlefaso_net_scraperimportLefasoNetScraperimportpandasaspdsection_url='https://lefaso.net/spip.php?rubrique473'scraper=LefasoNetScraper(section_url)data=scraper.run()df=pd.DataFrame.from_records(data)df.to_csv('path/to/df.csv')
Package: lefi
A discord API wrapper focused on clean code, and usabilityInstallationPoetrypoetry add lefiPippip install lefiExample(s)Here!DocumentationHere!ContributingIf you plan on contributing please open an issue beforehandFork the repo, and setup the poetry env (with dev dependencies)Install pre-commit hooks (makes it a lot easier for me)pre-commit installJoin the discord!DiscordNotable contributorsblanketsucks- collaboratoran-dyy- creator and maintainer
Package: lefse
LEfSeLEfSe (Linear discriminant analysis Effect Size) determines the features
(organisms, clades, operational taxonomic units, genes, or functions)
most likely to explain differences between classes by coupling standard
tests for statistical significance with additional tests encoding
biological consistency and effect relevance.LEfSe is available as aGalaxy module,
a Conda formula, a Docker image, and included in bioBakery (VM and
cloud). For additional information, please refer to theLEfSe
paper.InstallationLEfSe can be installed with Conda or run from a Docker image. Please
note, if you are using bioBakery (Vagrant VM or cloud) you do not need
to install LEfSe because the tool and its dependencies are already
installed.Install with Conda:$ conda install -c bioconda lefseInstall with Docker:$ docker run -it biobakery/lefse bashLEfSe requires R v. 3.6 or higher and the R libraries survival, mvtnorm, modeltools, coin, MASS.We provide support for LEfSe users. Please join ourbioBakery Support Forumdesignated specifically for LEfSe users.