name stringclasses 844
values | input_types listlengths 0 100 | output_type stringlengths 1 419 | code stringlengths 34 233k | dependencies listlengths 0 6 | lib_used listlengths 0 11 | imports listlengths 0 66 | line_count int64 3 199 | full_code stringlengths 39 1.01M | input_type_defs listlengths 1 12 ⌀ |
|---|---|---|---|---|---|---|---|---|---|
v0 | [] | typing.NoReturn | def v0() -> typing.NoReturn:
(v1, v2, v3, v4) = map(int, input().split())
v5 = 0
while True:
if v1 * v3 < v1 + v4:
if v1 * v3 >= v2:
break
v1 *= v3
v5 += 1
continue
v5 += (v2 - 1 - v1) // v4
break
print(v5) | [] | [] | [] | 13 | import typing
def main() -> typing.NoReturn:
x, y, a, b = map(int, input().split())
exp = 0
while True:
if x * a < x + b:
if x * a >= y: break
x *= a
exp += 1
continue
exp += (y - 1 - x) // b
break
print(exp)
main... | null |
v0 | [
"str",
"str"
] | dict | def v0(v1: str, v2: str) -> dict:
while True:
v3 = requests.get(v1, headers={'Authorization': 'token {0}'.format(v2)})
v3.raise_for_status()
yield v3.json()
if 'next' not in v3.links:
break
v1 = v3.links['next']['url'] | [] | [
"requests"
] | [
"import requests"
] | 8 | from config import Config
import requests
from filehandler import mkdir
from gitlib import check_name, mirror
from pathlib import Path
from logger import log_message, log_error
DEFAULT_HOST = "https://api.github.com/"
def backup(config: Config) -> bool:
if config.host is None or not config.host:
config.... | null |
v0 | [] | dict | def v0(self) -> dict:
v1 = {}
if hasattr(self, 'client_id'):
v1['clientId'] = self.client_id
if hasattr(self, 'country_code'):
v1['countryCode'] = self.country_code
if hasattr(self, 'namespace'):
v1['namespace'] = self.namespace
if hasattr(self, 'user_id'):
v1['userId... | [] | [] | [] | 11 | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | null |
v45 | [
"str"
] | v0 | def v45(self, v46: str) -> v0:
self.parent_category_path = v46
return self | [] | [] | [] | 3 | # Auto-generated at 2021-09-27T17:12:36.153434+08:00
# from: Justice Platform Service (3.24.0)
# Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# pylint: disable=duplicate-code
# py... | [
"class v0(Model):\n v1: str\n v2: str\n v3: str\n v4: str\n v5: str\n v6: str\n v7: List[v0]\n v8: bool\n\n def v9(self, v10: str) -> v0:\n self.namespace = v10\n return self\n\n def v11(self, v12: str) -> v0:\n self.parent_category_path = v12\n return self\... |
v45 | [
"str"
] | v0 | def v45(self, v46: str) -> v0:
self.username = v46
return self | [] | [] | [] | 3 | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-session-browser-service ()
# pylint: disab... | [
"class v0(Model):\n v1: ModelsGameSessionSetting\n v2: str\n v3: str\n v4: str\n v5: str\n\n def v6(self, v7: ModelsGameSessionSetting) -> v0:\n self.game_session_setting = v7\n return self\n\n def v8(self, v9: str) -> v0:\n self.game_version = v9\n return self\n\n ... |
v0 | [
"bool"
] | dict | def v0(self, v1: bool=False) -> dict:
v2 = {}
if hasattr(self, 'namespace') and self.namespace:
v2['namespace'] = str(self.namespace)
elif v1:
v2['namespace'] = str()
if hasattr(self, 'user_id') and self.user_id:
v2['userId'] = str(self.user_id)
elif v1:
v2['userId'] ... | [] | [] | [] | 27 | # Auto-generated at 2021-09-27T17:01:27.299302+08:00
# from: Justice Social Service (1.17.1)
# Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# pylint: disable=duplicate-code
# pyli... | null |
v13 | [
"v0",
"Any"
] | Any | def v13(self, v14: v0, v15):
self.remove_household(v14)
self.add_household_to_settlement(v14, v15) | [] | [] | [] | 3 | import statistics
import VegetationModel
import math
import numpy as np
import json
from ECAgent.Core import *
from ECAgent.Decode import IDecodable
from ECAgent.Environments import PositionComponent, discreteGridPosToID
from ECAgent.Collectors import Collector, FileCollector
from VegetationModel import SoilMoistureC... | [
"class v0(Agent, IDecodable):\n\n def __init__(self, v1: str, v2: Model, v3: int):\n super().__init__(v1, v2)\n self.addComponent(ResourceComponent(self, v2))\n self.addComponent(HouseholdRelationshipComponent(self, v2, v3))\n\n @staticmethod\n def v4(v5: dict):\n ResourceCompon... |
v0 | [
"Any",
"float"
] | Any | "def v0(self, v1, v2: float):\n self.forage_utility += (v1.forage_utility - self.forage_utility) (...TRUNCATED) | [] | [] | [] | 8 | "import json\nimport logging\nimport math\nimport numpy as np\nimport statistics\nimport time\n\nfro(...TRUNCATED) | null |
v0 | [
"str"
] | str | "def v0(v1: str) -> str:\n v2 = re.sub('\\\\(#[+-]?[0-9]*[.]?[0-9]*\\\\)', '', v1)\n for v3 in(...TRUNCATED) | [] | [
"re",
"string"
] | [
"import re",
"from string import punctuation"
] | 5 | "import re\nfrom string import punctuation\n\n\ndef preprocess(text: str) -> str:\n prep_text = r(...TRUNCATED) | null |
v0 | [
"int"
] | bool | "def v0(self, v1: int) -> bool:\n v2 = 2 ** 31 - 1\n if -(v2 + 1) <= v1 <= v2:\n v3 = s(...TRUNCATED) | [] | [] | [] | 9 | "from typing import List\n\n\nclass Solution:\n def isPalindrome(self, x: int) -> bool:\n (...TRUNCATED) | null |
End of preview. Expand in Data Studio
Functions-656K
six hundred fifty six thousand samples of code, annotated with input and output types as well as any dependencies or libraries required for their use. completely anonymized variables. i anonymized all the variables to sort of low-pass a bunch of high frequency features, a model of the space should be smoother to navigate.
1105k files from the stack -> 1376k cleanly typed functions w/ dependencies -> variable names anonymized -> 656k de-duplicated w minhash+lsh
licenses: check https://hf.co/datasets/bigcode/the-stack
filtering libraries:
use the following:dataset.filter(lambda x: False not in [label in allowed_set for label in x['lib_used']])where
allowed_set is a subset of this list, which is the master list of allowed libraries in the dataset:
"math", "cmath", "random", "statistics", "fractions", "decimal", "numbers",
"itertools", "functools", "operator",
"collections", "array", "bisect", "heapq", "weakref", "enum", "typing",
"string", "re", "textwrap", "pprint", "reprlib", "difflib",
"hashlib", "hmac", "secrets", "base64", "binascii", "quopri", "uu",
"copy", "contextlib", "abc", "dataclasses", "warnings", "gc",
"datetime", "calendar",
"inspect", "traceback", "ast", "tokenize", "keyword", "dis", "sys",
"json", "csv", "marshal",
"uuid",
"numpy", "scipy", "sympy", "sklearn", "statsmodels", "xgboost", "tqdm",
"shapely", "PyWavelets", "z3", "cvxpy",
"os", "io", "pathlib", "glob", "fnmatch", "linecache", "tempfile", "shutil",
"fileinput", "stat",
"pickle", "shelve", "dbm", "sqlite3",
"zipfile", "tarfile", "gzip", "bz2", "lzma", "zlib",
"configparser", "argparse", "getopt", "optparse", "logging", "getpass",
"profile", "cProfile", "pstats", "timeit", "tracemalloc", "faulthandler", "pdb",
"curses", "termios", "tty", "pty", "platform",
"plistlib", "netrc", "xdrlib", "mailbox", "mimetypes", "wave", "aifc",
"sndhdr", "imghdr", "colorsys", "chunk",
"sysconfig", "site", "resource",
"pandas", "matplotlib", "seaborn", "plotly", "torch", "tensorflow", "keras",
"gensim", "skimage", "PIL", "cv2", "nltk", "spacy", "dask", "polars",
"vaex", "h5py", "netCDF4", "xarray",
"Bio", "scikit-bio", "PyCogent",
"geopandas", "rasterio",
"rdkit", "openbabel", "pymatgen",
"astropy", "sunpy", "healpy",
"librosa",
"MDAnalysis", "OpenMM", "cartopy",
"subprocess", "shlex",
"socket", "ssl", "select", "selectors", "asyncio", "socketserver",
"http", "urllib", "ftplib", "poplib", "imaplib", "smtplib", "telnetlib",
"xmlrpc", "webbrowser", "cgi", "cgitb", "wsgiref", "http.server",
"threading", "multiprocessing", "concurrent", "queue", "sched",
"contextvars", "signal", "mmap",
"importlib", "runpy", "code", "codeop",
"ctypes", "cffi", "msvcrt", "winreg", "winsound", "posix", "pwd", "spwd",
"grp", "crypt", "fcntl", "syslog", "pipes",
"email",
"ossaudiodev", "audioop",
"bdb", "trace",
"transformers", "datasets", "requests", "beautifulsoup4", "selenium",
"folium", "qiskit"
- Downloads last month
- 10